]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
More bug #1077106 stuff, sorry -- modem induced impatiece!
authorMichael W. Hudson <mwh@python.net>
Mon, 31 Jan 2005 17:09:25 +0000 (17:09 +0000)
committerMichael W. Hudson <mwh@python.net>
Mon, 31 Jan 2005 17:09:25 +0000 (17:09 +0000)
This should go on whatever bugfix branches the other fetches up on.

Misc/NEWS
Objects/stringobject.c

index 92d94224fc4c2e8a44d74314411ddd661470889b..926ac5233d03332bcbf485a92dacc3418f7909d8 100644 (file)
--- 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
 -----------------
index b8e5f41342c2da19f8fed2a787bd6a97019b274d..b90221a6b87ce2e91434837f0b29d0d1a6cee1f2 100644 (file)
@@ -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++;