2013/11/7 victor.stinner <[email protected]>:
> http://hg.python.org/cpython/rev/99afa4c74436
> changeset: 86995:99afa4c74436
> user: Victor Stinner <[email protected]>
> date: Thu Nov 07 13:33:36 2013 +0100
> summary:
> Fix _Py_normalize_encoding(): ensure that buffer is big enough to store
> "utf-8"
> if the input string is NULL
>
> files:
> Objects/unicodeobject.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
>
> diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
> --- a/Objects/unicodeobject.c
> +++ b/Objects/unicodeobject.c
> @@ -2983,6 +2983,8 @@
> char *l_end;
>
> if (encoding == NULL) {
> + if (lower_len < 6)
How about doing something like strlen("utf-8") rather than hardcoding that?
--
Regards,
Benjamin
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com