$NetBSD: patch-au,v 1.1 2008/04/11 10:32:33 drochner Exp $ --- Modules/zlibmodule.c.orig 2008-04-11 12:21:45.000000000 +0200 +++ Modules/zlibmodule.c @@ -669,6 +669,10 @@ PyZlib_unflush(compobject *self, PyObjec 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;