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.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c
index 314a34e3dec..a8b66f3f2fe 100644
--- a/source/blender/python/generic/idprop_py_api.c
+++ b/source/blender/python/generic/idprop_py_api.c
@@ -20,6 +20,8 @@
#include <Python.h>
+#include <string.h>
+
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
@@ -370,6 +372,11 @@ static const char *idp_try_read_name(PyObject *name_obj)
"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 = "";
@@ -1190,8 +1197,12 @@ PyTypeObject BPy_IDGroup_Type = {
/* Methods to implement standard operations */
- NULL, /* destructor tp_dealloc; */
- (printfunc)NULL, /* printfunc tp_print; */
+ NULL, /* destructor tp_dealloc; */
+#if PY_VERSION_HEX >= 0x03080000
+ 0, /* tp_vectorcall_offset */
+#else
+ (printfunc)NULL, /* printfunc tp_print */
+#endif
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL, /* cmpfunc tp_compare; */
@@ -1599,8 +1610,12 @@ PyTypeObject BPy_IDArray_Type = {
/* Methods to implement standard operations */
- NULL, /* destructor tp_dealloc; */
- (printfunc)NULL, /* printfunc tp_print; */
+ NULL, /* destructor tp_dealloc; */
+#if PY_VERSION_HEX >= 0x03080000
+ 0, /* tp_vectorcall_offset */
+#else
+ (printfunc)NULL, /* printfunc tp_print */
+#endif
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL, /* cmpfunc tp_compare; */
@@ -1716,8 +1731,12 @@ PyTypeObject BPy_IDGroup_Iter_Type = {
/* Methods to implement standard operations */
- NULL, /* destructor tp_dealloc; */
- (printfunc)NULL, /* printfunc tp_print; */
+ NULL, /* destructor tp_dealloc; */
+#if PY_VERSION_HEX >= 0x03080000
+ 0, /* tp_vectorcall_offset */
+#else
+ (printfunc)NULL, /* printfunc tp_print */
+#endif
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
NULL, /* cmpfunc tp_compare; */