]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Restrict name_length to NAME_MAXLEN in unicodedata_UCD_lookup()
authorChristian Heimes <christian@python.org>
Wed, 14 Sep 2016 08:25:46 +0000 (10:25 +0200)
committerChristian Heimes <christian@python.org>
Wed, 14 Sep 2016 08:25:46 +0000 (10:25 +0200)
Modules/unicodedata.c

index fe4e90822a3096f3840d02029b20e1baec4de9b7..471d060c4a8f53db3fa26f5aae21eab6dccd2aaf 100644 (file)
@@ -1232,7 +1232,7 @@ unicodedata_UCD_lookup_impl(PyObject *self, const char *name,
 {
     Py_UCS4 code;
     unsigned int index;
-    if (name_length > INT_MAX) {
+    if (name_length > NAME_MAXLEN) {
         PyErr_SetString(PyExc_KeyError, "name too long");
         return NULL;
     }