UI: enable string properties for alt-click buttons for multiple objects #106599
|
@ -1918,7 +1918,7 @@ static void ui_selectcontext_apply(bContext *C,
|
|||
bool b;
|
||||
int i;
|
||||
float f;
|
||||
char str[MAX_NAME];
|
||||
char *str;
|
||||
PointerRNA p;
|
||||
} delta, min, max;
|
||||
|
||||
|
@ -1953,7 +1953,7 @@ static void ui_selectcontext_apply(bContext *C,
|
|||
}
|
||||
else if (rna_type == PROP_STRING) {
|
||||
/* Not a delta in fact. */
|
||||
RNA_property_string_get(&but->rnapoin, prop, delta.str);
|
||||
delta.str = RNA_property_string_get_alloc(&but->rnapoin, prop, nullptr, 0, nullptr);
|
||||
lichtwerk marked this conversation as resolved
Outdated
|
||||
}
|
||||
|
||||
# ifdef USE_ALLSELECT_LAYER_HACK
|
||||
|
@ -2035,6 +2035,9 @@ static void ui_selectcontext_apply(bContext *C,
|
|||
|
||||
RNA_property_update(C, &lptr, prop);
|
||||
}
|
||||
if (rna_type == PROP_STRING) {
|
||||
MEM_freeN(delta.str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
The size of the string isn't known, this could easily overrun the buffer length.
Using
RNA_property_string_get_alloc
avoids the problem.