diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-07 12:33:36 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-07 12:33:36 (GMT) |
commit | df23e30bea2741087440c186e645e6ae4c218651 (patch) | |
tree | 85565f759a339e1d2199cf45d0ce387a8b5478e8 | |
parent | e75fc148136bbef192c5572c14f3abf1f67abc57 (diff) | |
download | cpython-df23e30bea2741087440c186e645e6ae4c218651.zip cpython-df23e30bea2741087440c186e645e6ae4c218651.tar.gz cpython-df23e30bea2741087440c186e645e6ae4c218651.tar.bz2 |
Fix _Py_normalize_encoding(): ensure that buffer is big enough to store "utf-8"
if the input string is NULL
-rw-r--r-- | Objects/unicodeobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 4ae7377..1375ef3 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; } |