Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/generic/idprop_py_api.c')
-rw-r--r--source/blender/python/generic/idprop_py_api.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index a8b66f3f2fe..63fb685e66d 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -20,8 +20,6 @@
#include <Python.h>
-#include <string.h>
-
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
@@ -255,7 +253,7 @@ static int BPy_IDGroup_SetName(BPy_IDProperty *self, PyObject *value, void *UNUS
name = _PyUnicode_AsStringAndSize(value, &name_size);
- if (name_size > MAX_IDPROP_NAME) {
+ if (name_size >= MAX_IDPROP_NAME) {
PyErr_SetString(PyExc_TypeError, "string length cannot exceed 63 characters!");
return -1;
}
@@ -367,16 +365,11 @@ 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;
}
-
- if (strchr(name, '\"') || strchr(name, '\\') || strchr(name, '\'')) {
- PyErr_SetString(PyExc_KeyError, "IDProperty names cannot include \", \\, or \'");
- return NULL;
- }
}
else {
name = "";