Commit graph

126 commits

Author SHA1 Message Date
Benjamin Peterson
b1db758061 reject negative data_size 2016-01-21 22:02:46 -08:00
Benjamin Peterson
c4032da201 prevent buffer overflow in get_data (closes #26171) 2016-01-20 22:23:44 -08:00
Benjamin Peterson
ef9cf08352 fix refleak in error condition 2016-01-20 22:06:43 -08:00
Serhiy Storchaka
1a1ff29659 Issue #23446: Use PyMem_New instead of PyMem_Malloc to avoid possible integer
overflows.  Added few missed PyErr_NoMemory().
2015-02-16 13:28:22 +02:00
Benjamin Peterson
34c1540009 merge backout for #20621 2014-02-16 14:17:28 -05:00
Benjamin Peterson
766e10c4a8 merge 3.3 2014-01-09 09:36:23 -06:00
Benjamin Peterson
21e7d4cd5e fix zipimport ref leak 2014-01-09 09:36:10 -06:00
Gregory P. Smith
2e385e2592 Fixes issue #19081: When a zipimport .zip file in sys.path being imported from
is modified during the lifetime of the Python process after zipimport has
already cached the zip's table of contents we detect this and recover
rather than read bad data from the .zip (causing odd import errors).
2014-01-07 18:34:23 -08:00
Gregory P. Smith
2bcbc14117 Fixes Issue #19081: When a zipimport .zip file in sys.path being imported from
is modified during the lifetime of the Python process after zipimport has
already cached the zip's table of contents we detect this and recover
rather than read bad data from the .zip (causing odd import errors).
2014-01-07 18:30:07 -08:00
Victor Stinner
651f9f77f3 Issue #19515: Remove duplicated identifiers in zipimport.c 2013-11-12 21:44:18 +01:00
Victor Stinner
af8b7e8233 Issue #18408: Fix zipimport, handle PyUnicode_Substring() and get_subname() failures 2013-10-29 01:46:24 +01:00
Victor Stinner
73660af6af Issue #19428: zipimport now handles errors when reading truncated or invalid
ZIP archive.
2013-10-29 01:43:44 +01:00
Victor Stinner
daf455554b Issue #18571: Implementation of the PEP 446: file descriptors and file handles
are now created non-inheritable; add functions os.get/set_inheritable(),
os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
2013-08-28 00:53:59 +02:00
Brett Cannon
83358c9f13 Grammatical mistake in a comment 2013-06-20 21:30:32 -04:00
Serhiy Storchaka
0e6b7b5cd2 Issue #8745: Small speed up zipimport on Windows. Patch by Catalin Iacob. 2013-02-16 17:43:45 +02:00
Jesus Cea
fb22f542d2 MERGE: Closes #15897: zipimport.c doesn't check return value of fseek() 2012-10-03 03:00:37 +02:00
Jesus Cea
09bf7a799d Closes #15897: zipimport.c doesn't check return value of fseek() 2012-10-03 02:13:05 +02:00
Christian Heimes
1b5c76a283 Fixed two memory leaks in make_filename() in zipimport.c. The allocated buffer wasn't cleaned up in two error cases. CID 486832 2012-09-10 02:00:34 +02:00
Stefan Krah
000fde9651 Closes #15737: Fix potential NULL dereference in zipimport.c. 2012-08-20 14:14:49 +02:00
Benjamin Peterson
46c214d893 capitialize enum members 2012-05-25 10:22:29 -07:00
Benjamin Peterson
18eac4a1d6 use PyDict_Contains 2012-05-25 00:24:42 -07:00
Benjamin Peterson
a6a7a1accf return NULL on error 2012-05-25 00:22:04 -07:00
Benjamin Peterson
2d12e1458f actually return the result 2012-05-25 00:19:40 -07:00
Benjamin Peterson
5ed7bd79df simplify and rewrite the zipimport part of 702009f3c0b1 a bit 2012-05-24 22:54:15 -07:00
Benjamin Peterson
209e04c201 plug ref leak 2012-05-24 22:35:39 -07:00
Eric V. Smith
984b11f88f issue 14660: Implement PEP 420, namespace packages. 2012-05-24 20:21:04 -04:00
Gregory P. Smith
cc6abd56b8 Fix zipimport.c's read_directory() to use appropriate types for the values
being read from the header vs the values being used by fseek and ftell
(Py_ssize_t for those).  Updates the Py_BuildValue format string to match
(including several existing wrong 'i's that should have been 'l's).
2012-01-30 15:55:29 -08:00
Gregory P. Smith
ab32066e65 Fix zip_import.c's read_directory() to use appropriate types for the values
being read from the header vs the values being used by fseek and ftell
(Py_ssize_t for those) and how they are computed.  Py_ssize_t is used for
actual file offsets so that files greater than 2gigs could be supported.
Updates the Py_BuildValue format string to match (including several existing
wrong 'i's that should have been 'l's).
2012-01-30 15:17:33 -08:00
Victor Stinner
bd206e27a4 Handle correctly _Py_fopen() error: don't replace the exception 2011-12-18 21:04:17 +01:00
Antoine Pitrou
5136ac0ca2 Issue #13645: pyc files now contain the size of the corresponding source
code, to avoid timestamp collisions (especially on filesystems with a low
timestamp resolution) when checking for freshness of the bytecode.
2012-01-13 18:52:16 +01:00
Victor Stinner
3573476271 (Merge 3.2) Handle correctly _Py_fopen() error: don't replace the exception 2011-12-18 21:05:22 +01:00
Victor Stinner
bd0850b857 import.c now catchs _Py_stat() exceptions
_Py_stat() now returns -2 if an exception was raised.
2011-12-18 20:47:30 +01:00
Martin v. Löwis
5156f2ca9a Drop unused variable. 2011-10-31 09:05:10 +01:00
Martin v. Löwis
cfa6129276 Fix typo. 2011-10-31 09:01:22 +01:00
Martin v. Löwis
a72e78b3b1 Replace Py_UCS4_ API with Unicode API. 2011-10-31 08:33:37 +01:00
Martin v. Löwis
bd928fef42 Rename _Py_identifier to _Py_IDENTIFIER. 2011-10-14 10:20:37 +02:00
Victor Stinner
3f528f0c1b Fix a compiler warning in zipimport 2011-10-11 22:28:56 +02:00
Martin v. Löwis
1ee1b6fe0d Use identifier API for PyObject_GetAttrString. 2011-10-10 18:11:30 +02:00
Georg Brandl
4cb0de246c Rename new macros to conform to naming rules (function macros have "Py" prefix, not "PY"). 2011-09-28 21:49:49 +02:00
Martin v. Löwis
d63a3b8beb Implement PEP 393. 2011-09-28 07:41:54 +02:00
Victor Stinner
9a2261a372 zipimport: initialize fullpath to NULL
In some cases, fullpath value is used whereas fullpath was not always
initialized. Warning found by the Clang Static Analyzer.
2011-05-26 13:59:41 +02:00
Gregory P. Smith
95c7c46077 avoid a compiler warning. the compiler doesn't know that the static
struct guarantees the loop will always be run once to initialize code.
2011-05-21 05:19:42 -07:00
Victor Stinner
21809a6938 (Merge 3.2) Issue #12124: zipimport doesn't keep a reference to
zlib.decompress() anymore to be able to unload the module.
2011-05-20 00:22:39 +02:00
Victor Stinner
4445ec81c1 (Merge 3.1) Issue #12124: zipimport doesn't keep a reference to
zlib.decompress() anymore to be able to unload the module.
2011-05-20 00:18:58 +02:00
Victor Stinner
4925cde1cc Issue #12124: zipimport doesn't keep a reference to zlib.decompress() anymore
to be able to unload the module.
2011-05-20 00:16:09 +02:00
Ezio Melotti
3b3499ba69 #11565: Merge with 3.1. 2011-03-16 11:35:38 +02:00
Ezio Melotti
13925008dc #11565: Fix several typos. Patch by Piotr Kasprzyk. 2011-03-16 11:05:33 +02:00
Ezio Melotti
4969f709cc #11515: Merge with 3.1. 2011-03-15 05:59:46 +02:00
Ezio Melotti
42da663e6f #11515: fix several typos. Patch by Piotr Kasprzyk. 2011-03-15 05:18:48 +02:00
Victor Stinner
f6b563af2d Issue #3080: zipimport has a full unicode suppport
- Use Unicode for module paths and names, self->archive and self->prefix
 - Format module names and paths use %R instead of '%U' to escape surrogate
   characters (PEP 383)
 - Use PyImport_ExecCodeModuleObject() instead of PyImport_ExecCodeModuleEx()
 - Use PyImport_AddModuleObject() instead of PyImport_AddModule()
2011-03-14 20:46:50 -04:00