]> granicus.if.org Git - python/commitdiff
Allocate one more character, so that the terminating
authorWalter Dörwald <walter@livinglogic.de>
Fri, 18 May 2007 11:30:40 +0000 (11:30 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Fri, 18 May 2007 11:30:40 +0000 (11:30 +0000)
nullbyte can be copied.

Objects/unicodeobject.c

index 7e455a5e328778295aadb86be1edc044e7f657ca..9937705eef1da4e0ce35e3f2b6e21bfe63cae4d7 100644 (file)
@@ -427,7 +427,7 @@ PyObject *PyUnicode_FromString(const char *u)
        }
     }
 
-    unicode = _PyUnicode_New(size);
+    unicode = _PyUnicode_New(size+1);
     if (!unicode)
         return NULL;