[Python-checkins] r52016 - in python/branches/release24-maint: Misc/NEWS Modules/_cursesmodule.c

andrew.kuchling python-checkins at python.org
Wed Sep 27 21:04:54 CEST 2006


Author: andrew.kuchling
Date: Wed Sep 27 21:04:53 2006
New Revision: 52016

Modified:
   python/branches/release24-maint/Misc/NEWS
   python/branches/release24-maint/Modules/_cursesmodule.c
Log:
[Backport of rev. 51683 by neal.norwitz]

Bug #1548092: fix curses.tparm seg fault on invalid input.  Needs
backport to 2.5.1 and earlier.


Modified: python/branches/release24-maint/Misc/NEWS
==============================================================================
--- python/branches/release24-maint/Misc/NEWS	(original)
+++ python/branches/release24-maint/Misc/NEWS	Wed Sep 27 21:04:53 2006
@@ -61,6 +61,8 @@
 - Bug #1471938: Fix curses module build problem on Solaris 8; patch by
   Paul Eggert.
 
+- Bug #1548092: fix curses.tparm() segfault on invalid input.
+
 - cursesmodule: fix a number of reference leaks with 'python -v'; handle
   failure from PyModule_GetDict (Klocwork 208).
 

Modified: python/branches/release24-maint/Modules/_cursesmodule.c
==============================================================================
--- python/branches/release24-maint/Modules/_cursesmodule.c	(original)
+++ python/branches/release24-maint/Modules/_cursesmodule.c	Wed Sep 27 21:04:53 2006
@@ -2278,6 +2278,10 @@
 	}
 
 	result = tparm(fmt,i1,i2,i3,i4,i5,i6,i7,i8,i9);
+	if (!result) {
+		PyErr_SetString(PyCursesError, "tparm() returned NULL");
+  		return NULL;
+	}
 
 	return PyString_FromString(result);
 }


More information about the Python-checkins mailing list