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/makesrna/intern/rna_ui.c')
-rw-r--r--source/blender/makesrna/intern/rna_ui.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_ui.c b/source/blender/makesrna/intern/rna_ui.c
index d33e96df2e6..cbd524680c1 100644
--- a/source/blender/makesrna/intern/rna_ui.c
+++ b/source/blender/makesrna/intern/rna_ui.c
@@ -163,6 +163,11 @@ static StructRNA *rna_Panel_register(const bContext *C, ReportList *reports, voi
/* validate the python class */
if(validate(&dummyptr, data, have_function) != 0)
return NULL;
+
+ if(strlen(identifier) >= sizeof(dummypt.idname)) {
+ BKE_reportf(reports, RPT_ERROR, "registering panel class: '%s' is too long, maximum length is %d.", identifier, sizeof(dummypt.idname));
+ return NULL;
+ }
if(!(art=region_type_find(reports, dummypt.space_type, dummypt.region_type)))
return NULL;
@@ -260,7 +265,12 @@ static StructRNA *rna_Header_register(const bContext *C, ReportList *reports, vo
/* validate the python class */
if(validate(&dummyhtr, data, have_function) != 0)
return NULL;
-
+
+ if(strlen(identifier) >= sizeof(dummyht.idname)) {
+ BKE_reportf(reports, RPT_ERROR, "registering header class: '%s' is too long, maximum length is %d.", identifier, sizeof(dummyht.idname));
+ return NULL;
+ }
+
if(!(art=region_type_find(reports, dummyht.space_type, RGN_TYPE_HEADER)))
return NULL;
@@ -373,6 +383,11 @@ static StructRNA *rna_Menu_register(const bContext *C, ReportList *reports, void
/* validate the python class */
if(validate(&dummymtr, data, have_function) != 0)
return NULL;
+
+ if(strlen(identifier) >= sizeof(dummymt.idname)) {
+ BKE_reportf(reports, RPT_ERROR, "registering menu class: '%s' is too long, maximum length is %d.", identifier, sizeof(dummymt.idname));
+ return NULL;
+ }
/* check if we have registered this menu type before, and remove it */
mt= WM_menutype_find(dummymt.idname, TRUE);