[Bf-blender-cvs] [6c9263d817b] master: Fix off by one error in id-property name validation
Campbell Barton
noreply at git.blender.org
Wed Dec 9 07:21:14 CET 2020
Commit: 6c9263d817b7b4dcd4d6e1f365d1db0a83de6e51
Author: Campbell Barton
Date: Wed Dec 9 17:16:43 2020 +1100
Branches: master
https://developer.blender.org/rB6c9263d817b7b4dcd4d6e1f365d1db0a83de6e51
Fix off by one error in id-property name validation
The Python API accepted a name with 64 bytes, clipping it to 63.
===================================================================
M source/blender/python/generic/idprop_py_api.c
===================================================================
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index 1a7a0ecc6d7..c125edea19f 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -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;
More information about the Bf-blender-cvs
mailing list