summaryrefslogtreecommitdiff
path: root/lang/python24/patches/patch-au
blob: 037b57508f243f133cb3d98d470e88751b067bf2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
$NetBSD: patch-au,v 1.1.2.2 2008/04/20 15:56:44 spz 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;