Some strings to store ID names were too small, could cause stack corruption.

corrected these and replaced 'sizeof(((ID *)NULL)->name)-2' with 'MAX_ID_NAME-2'.
This commit is contained in:
2011-04-19 06:59:49 +00:00
parent 6a91cf9adb
commit 5b920bc2ff
13 changed files with 19 additions and 19 deletions

View File

@@ -52,7 +52,7 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind
{
uiBut *but=NULL;
const char *propname= RNA_property_identifier(prop);
char prop_item[sizeof(((IDProperty *)NULL)->name)+4]; /* size of the ID prop name + room for [""] */
char prop_item[MAX_IDPROP_NAME+4]; /* size of the ID prop name + room for [""] */
int arraylen= RNA_property_array_length(ptr, prop);
/* support for custom props */