From: Walter Dörwald Date: Fri, 18 May 2007 11:30:40 +0000 (+0000) Subject: Allocate one more character, so that the terminating X-Git-Tag: v3.0a1~928 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9992835c6edd105e30722d76c97e4d84a5075a48;p=python Allocate one more character, so that the terminating nullbyte can be copied. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 7e455a5e32..9937705eef 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -427,7 +427,7 @@ PyObject *PyUnicode_FromString(const char *u) } } - unicode = _PyUnicode_New(size); + unicode = _PyUnicode_New(size+1); if (!unicode) return NULL;