mirror of
https://github.com/python/cpython.git
synced 2024-12-14 20:34:12 +08:00
Fix _Py_normalize_encoding(): ensure that buffer is big enough to store "utf-8"
if the input string is NULL
This commit is contained in:
parent
e75fc14813
commit
df23e30bea
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user