summaryrefslogtreecommitdiff
path: root/lang/python25/patches/patch-ce
blob: 6ec9ec40632ba89c8d053fae5168b13f58778bb8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$NetBSD: patch-ce,v 1.1.2.2 2008/09/02 14:13:33 rtr Exp $

Patch for CVE-2008-3142 taken from Gentoo.

--- Modules/selectmodule.c.orig	2006-07-10 02:18:57.000000000 +0100
+++ Modules/selectmodule.c	2008-08-30 10:39:43.000000000 +0100
@@ -349,10 +349,12 @@
 {
 	Py_ssize_t i, pos;
 	PyObject *key, *value;
+        struct pollfd *old_ufds = self->ufds;
 
 	self->ufd_len = PyDict_Size(self->dict);
-	PyMem_Resize(self->ufds, struct pollfd, self->ufd_len);
+	PyMem_RESIZE(self->ufds, struct pollfd, self->ufd_len);
 	if (self->ufds == NULL) {
+                self->ufds = old_ufds;
 		PyErr_NoMemory();
 		return 0;
 	}