diff options
Diffstat (limited to 'Modules/zipimport.c')
-rw-r--r-- | Modules/zipimport.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/zipimport.c b/Modules/zipimport.c index 937b0f7..be141d0 100644 --- a/Modules/zipimport.c +++ b/Modules/zipimport.c @@ -249,6 +249,7 @@ make_filename(char *prefix, char *name, char *path) *p = SEP; } len += strlen(name); + assert(len < INT_MAX); return (int)len; } @@ -808,7 +809,8 @@ get_data(char *archive, PyObject *toc_entry) PyObject *raw_data, *data = NULL, *decompress; char *buf; FILE *fp; - int err, bytes_read = 0; + int err; + Py_ssize_t bytes_read = 0; long l; char *datapath; long compress, data_size, file_size, file_offset; @@ -1024,7 +1026,7 @@ get_mtime_of_source(ZipImporter *self, char *path) { PyObject *toc_entry; time_t mtime = 0; - int lastchar = strlen(path) - 1; + Py_ssize_t lastchar = strlen(path) - 1; char savechar = path[lastchar]; path[lastchar] = '\0'; /* strip 'c' or 'o' from *.py[co] */ toc_entry = PyDict_GetItemString(self->files, path); |