forked from Lainports/freebsd-ports
Add patch for integer overflow in zipimport module to all our python ports.
While I'm here, get rid of -f flag in ${RM} invocation, because ${RM} already
expands to rm -f, so in result we are getting something like:
/bin/rm -f -f /wrkdirs/usr/ports/lang/python35/work/stage/usr/local/lib/libpython3.so
PR: 210325
Submitted by: Vladimir Krstulja <vlad-fbsd@acheronmedia.com>
Security: 1d0f6852-33d8-11e6-a671-60a44ce6887b
With hat: python
17 lines
600 B
C
17 lines
600 B
C
|
|
Bug: http://bugs.python.org/issue26171
|
|
|
|
--- Modules/zipimport.c.orig 2015-12-05 19:47:16 UTC
|
|
+++ Modules/zipimport.c
|
|
@@ -895,6 +895,11 @@ get_data(char *archive, PyObject *toc_en
|
|
PyMarshal_ReadShortFromFile(fp); /* local header size */
|
|
file_offset += l; /* Start of file data */
|
|
|
|
+ if (data_size > LONG_MAX - 1) {
|
|
+ fclose(fp);
|
|
+ PyErr_NoMemory();
|
|
+ return NULL;
|
|
+ }
|
|
raw_data = PyString_FromStringAndSize((char *)NULL, compress == 0 ?
|
|
data_size : data_size + 1);
|
|
if (raw_data == NULL) {
|