Apply [#25296] Fix for [#24636]

Bug reported by Dominique Lorre
Fix submitted by Jeroen Bakker

When importing COLLADA files, the name of a custom data layer can be longer than 32 bytes. Make sure only 32 bytes are copied.
This commit is contained in:
Nathan Letwory 2010-12-19 20:23:30 +00:00
parent b8e47fd160
commit fad7121ca3
1 changed files with 1 additions and 2 deletions

View File

@ -1444,9 +1444,8 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
data->layers[index].type = type;
data->layers[index].flag = flag;
data->layers[index].data = newlayerdata;
if(name || (name=typeInfo->defaultname)) {
strcpy(data->layers[index].name, name);
BLI_strncpy(data->layers[index].name, name, 32);
CustomData_set_layer_unique_name(data, index);
}
else