diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-23 22:19:50 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-23 22:19:50 +0400 |
commit | d003a083027bb63f9d79a98cfb173f45318535c8 (patch) | |
tree | 74e0198970b55c02746af9ac5833fbf94b061d59 /source/blender/editors/interface/interface_templates.c | |
parent | 0fcc6baa0b87c19bb39e39da932bfdf208cc67b3 (diff) |
Fix stack corruptions in special cases
Issue was caused by wrong array length used
for result of name_uiprefix_id, which shall
actually be 1 byte bugger than MAX_ID_NAME.
Reported by Sebastian Koenig in IRC.
Diffstat (limited to 'source/blender/editors/interface/interface_templates.c')
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index b87c067a1ab..f07b31eff17 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -151,7 +151,10 @@ static void id_search_cb(const bContext *C, void *arg_template, const char *str, continue; if (BLI_strcasestr(id->name + 2, str)) { - char name_ui[MAX_ID_NAME]; + /* +1 is needed because name_uiprefix_id used 3 letter prefix + * followed by ID_NAME-2 characters from id->name + */ + char name_ui[MAX_ID_NAME + 1]; name_uiprefix_id(name_ui, id); iconid = ui_id_icon_get((bContext *)C, id, template->preview); |