$OpenBSD: patch-Modules_zlibmodule_c,v 1.1 2008/08/06 03:23:31 djm Exp $ --- Modules/zlibmodule.c.orig Wed Nov 21 11:44:57 2007 +++ Modules/zlibmodule.c Tue Aug 5 18:18:52 2008 @@ -774,6 +774,10 @@ PyZlib_unflush(compobject *self, PyObject *args) 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;