From: Michael W. Hudson Date: Mon, 31 Jan 2005 17:09:25 +0000 (+0000) Subject: More bug #1077106 stuff, sorry -- modem induced impatiece! X-Git-Tag: v2.5a0~2068 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=faa7648ffe6fbc568eeb6457815bd85cef21bfbd;p=thirdparty%2FPython%2Fcpython.git More bug #1077106 stuff, sorry -- modem induced impatiece! This should go on whatever bugfix branches the other fetches up on. --- diff --git a/Misc/NEWS b/Misc/NEWS index 92d94224fc4c..926ac5233d03 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -21,6 +21,8 @@ Core and builtins - set and frozenset objects can now be marshalled. SF #1098985. +- Bug #1077106: Poor argument checking could cause memory corruption + in calls to os.read(). Extension Modules ----------------- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index b8e5f41342c2..b90221a6b87c 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -52,6 +52,7 @@ PyObject * PyString_FromStringAndSize(const char *str, int size) { register PyStringObject *op; + assert(size >= 0); if (size == 0 && (op = nullstring) != NULL) { #ifdef COUNT_ALLOCS null_strings++;