Fix off by one error in id-property name validation

The Python API accepted a name with 64 bytes, clipping it to 63.
This commit is contained in:
2020-12-09 17:16:43 +11:00
parent 3b5a81936d
commit 6c9263d817

View File

@@ -365,7 +365,7 @@ static const char *idp_try_read_name(PyObject *name_obj)
return NULL;
}
if (name_size > MAX_IDPROP_NAME) {
if (name_size >= MAX_IDPROP_NAME) {
PyErr_SetString(PyExc_KeyError,
"the length of IDProperty names is limited to 63 characters");
return NULL;