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:
authorCampbell Barton <ideasman42@gmail.com>2011-03-05 08:02:37 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-03-05 08:02:37 +0300
commit91f4a4d7e16643750c119e1c6684f63038d0be02 (patch)
treec4fbccd6f2d09aecb397a5d12e4be9b0357ae4e3 /source/blender/python/intern/bpy_rna_array.c
parent8f6e5776207a473366bc2307226f329153819460 (diff)
fix [#26323] Crash when adding to a vertex group with a raw in
Diffstat (limited to 'source/blender/python/intern/bpy_rna_array.c')
-rw-r--r--source/blender/python/intern/bpy_rna_array.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c
index 8e7aba42a99..5e4291dff96 100644
--- a/source/blender/python/intern/bpy_rna_array.c
+++ b/source/blender/python/intern/bpy_rna_array.c
@@ -67,6 +67,10 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
if (dim + 1 < totdim) {
/* check that a sequence contains dimsize[dim] items */
const int seq_size= PySequence_Size(seq);
+ if(seq_size == -1) {
+ PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not %s", error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name);
+ return 0;
+ }
for (i= 0; i < seq_size; i++) {
PyObject *item;
int ok= 1;
@@ -100,6 +104,10 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[]
else {
/* check that items are of correct type */
const int seq_size= PySequence_Size(seq);
+ if(seq_size == -1) {
+ PyErr_Format(PyExc_ValueError, "%s sequence expected at dimension %d, not %s", error_prefix, (int)dim + 1, Py_TYPE(seq)->tp_name);
+ return 0;
+ }
for (i= 0; i < seq_size; i++) {
PyObject *item= PySequence_GetItem(seq, i);