diff options
author | Campbell Barton <ideasman42@gmail.com> | 2015-02-18 23:01:49 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2015-02-18 23:01:49 +0300 |
commit | 86e04c4ca902e8c9752e708225f262cd0283f8b4 (patch) | |
tree | f366689738e1e43f3f2db549f61aafd3c8cd4da1 /source/blender/makesrna | |
parent | 9d464a7538f034967b019c8c657ab9e4bbfbdfcc (diff) |
RNA: assert on over-sized array index access
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 76c722564a0..48514745426 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -1907,6 +1907,7 @@ int RNA_property_boolean_get_index(PointerRNA *ptr, PropertyRNA *prop, int index BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); + BLI_assert(index < len); if (len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); @@ -1970,6 +1971,7 @@ void RNA_property_boolean_set_index(PointerRNA *ptr, PropertyRNA *prop, int inde BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); + BLI_assert(index < len); if (len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_array(ptr, prop, tmp); @@ -2020,6 +2022,7 @@ int RNA_property_boolean_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i BLI_assert(RNA_property_type(prop) == PROP_BOOLEAN); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); + BLI_assert(index < prop->totarraylength); if (len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_boolean_get_default_array(ptr, prop, tmp); @@ -2159,6 +2162,7 @@ int RNA_property_int_get_index(PointerRNA *ptr, PropertyRNA *prop, int index) BLI_assert(RNA_property_type(prop) == PROP_INT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); + BLI_assert(index < len); if (len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_array(ptr, prop, tmp); @@ -2225,6 +2229,7 @@ void RNA_property_int_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, i BLI_assert(RNA_property_type(prop) == PROP_INT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); + BLI_assert(index < len); if (len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_array(ptr, prop, tmp); @@ -2271,6 +2276,7 @@ int RNA_property_int_get_default_index(PointerRNA *ptr, PropertyRNA *prop, int i BLI_assert(RNA_property_type(prop) == PROP_INT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); + BLI_assert(index < prop->totarraylength); if (len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_int_get_default_array(ptr, prop, tmp); @@ -2426,6 +2432,7 @@ float RNA_property_float_get_index(PointerRNA *ptr, PropertyRNA *prop, int index BLI_assert(RNA_property_type(prop) == PROP_FLOAT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); + BLI_assert(index < len); if (len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_array(ptr, prop, tmp); @@ -2504,6 +2511,7 @@ void RNA_property_float_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, BLI_assert(RNA_property_type(prop) == PROP_FLOAT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); + BLI_assert(index < len); if (len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_array(ptr, prop, tmp); @@ -2554,6 +2562,7 @@ float RNA_property_float_get_default_index(PointerRNA *ptr, PropertyRNA *prop, i BLI_assert(RNA_property_type(prop) == PROP_FLOAT); BLI_assert(RNA_property_array_check(prop) != false); BLI_assert(index >= 0); + BLI_assert(index < prop->totarraylength); if (len <= RNA_MAX_ARRAY_LENGTH) { RNA_property_float_get_default_array(ptr, prop, tmp); |