Commits

Anonymous committed 61a3305

- Issue #2586: Fix CVE-2008-1721, zlib crash from
zlib.decompressobj().flush(val) when val is not positive.

  • Participants
  • Parent commits 8d6e249
  • Branches 2.4

Comments (0)

Files changed (2)

 - Issue #1179: Fix CVE-2007-4965 and CVE-2008-1679, multiple integer
   overflows in the imageop and rgbimgmodule modules.
 
+- Issue #2586: Fix CVE-2008-1721, zlib crash from
+  zlib.decompressobj().flush(val) when val is not positive.
+
 Extension Modules
 -----------------
 

Modules/zlibmodule.c

 
     if (!PyArg_ParseTuple(args, "|i:flush", &length))
 	return NULL;
+    if (length <= 0) {
+	PyErr_SetString(PyExc_ValueError, "length must be greater than zero");
+	return NULL;
+    }
     if (!(retval = PyString_FromStringAndSize(NULL, length)))
 	return NULL;