summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS2
-rw-r--r--Objects/stringobject.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 92d9422..926ac52 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 b8e5f41..b90221a 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++;