diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2013-11-07 13:33:36 +0100 |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2013-11-07 13:33:36 +0100 |
| commit | df23e30bea2741087440c186e645e6ae4c218651 (patch) | |
| tree | 85565f759a339e1d2199cf45d0ce387a8b5478e8 | |
| parent | e75fc148136bbef192c5572c14f3abf1f67abc57 (diff) | |
| download | cpython-git-df23e30bea2741087440c186e645e6ae4c218651.tar.gz | |
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 4ae73771f2..1375ef3093 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; } |
