diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-12-22 13:04:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-12-22 13:04:15 +0300 |
commit | e207d045322db4656f42f68ae9fa092ac1478635 (patch) | |
tree | 7126490a68ff55d12a9197f1cabd3cf8e0c3b527 /source/blender/makesrna/intern/rna_ID.c | |
parent | 8f5b2e946bd24cc4ee2b7496b1e022cb24f56f4f (diff) |
quite a few python panels (10 or so) had names longer then the PanelType allowed,
for panels it would fail silently but for menu's it meant further references would give errors.
increase the registered class name from 32 to 64 and raise an error if the limit reached.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 2aeb600bc42..a250f0a49b4 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -205,6 +205,15 @@ StructRNA *rna_IDPropertyGroup_register(const bContext *C, ReportList *reports, if(validate(&dummyptr, data, NULL) != 0) return NULL; + /* note: it looks like there is no length limit on the srna id since its + * just a char pointer, but take care here, also be careful that python + * owns the string pointer which it could potentually free while blender + * is running. */ + if(strlen(identifier) >= sizeof(((IDProperty *)NULL)->name)) { + BKE_reportf(reports, RPT_ERROR, "registering id property class: '%s' is too long, maximum length is %d.", identifier, sizeof(((IDProperty *)NULL)->name)); + return NULL; + } + return RNA_def_struct(&BLENDER_RNA, identifier, "IDPropertyGroup"); // XXX } |