From: Victor Stinner Date: Thu, 7 Nov 2013 12:33:36 +0000 (+0100) Subject: Fix _Py_normalize_encoding(): ensure that buffer is big enough to store "utf-8" X-Git-Tag: v3.4.0b1~347 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=df23e30bea2741087440c186e645e6ae4c218651;p=thirdparty%2FPython%2Fcpython.git Fix _Py_normalize_encoding(): ensure that buffer is big enough to store "utf-8" if the input string is NULL --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 4ae73771f238..1375ef3093d7 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -2983,6 +2983,8 @@ _Py_normalize_encoding(const char *encoding, char *l_end; if (encoding == NULL) { + if (lower_len < 6) + return 0; strcpy(lower, "utf-8"); return 1; }