memory allocation (CVE-2008-2315 and CVE-2008-2316) - also apply upstream svn rev.65262, fixes overflow checks in memory allocation (CVE-2008-3142 and CVE-2008-3144) Approved by: portmgr (pav) Security: http://www.vuxml.org/freebsd/0dccaa28-7f3c-11dd-8de5-0030843d3802.html
13 lines
424 B
C
13 lines
424 B
C
--- Objects/bufferobject.c.orig 2008-03-02 20:20:32.000000000 +0100
|
|
+++ Objects/bufferobject.c
|
|
@@ -384,6 +384,10 @@ buffer_repeat(PyBufferObject *self, int
|
|
count = 0;
|
|
if (!get_buf(self, &ptr, &size))
|
|
return NULL;
|
|
+ if (count > INT_MAX / size) {
|
|
+ PyErr_SetString(PyExc_MemoryError, "result too large");
|
|
+ return NULL;
|
|
+ }
|
|
ob = PyString_FromStringAndSize(NULL, size * count);
|
|
if ( ob == NULL )
|
|
return NULL;
|