Fix invalid collection length for dummy unit collection

While this didn't show up as a bug, if this length was used it could
result in an out of bounds read.
This commit is contained in:
Campbell Barton 2023-10-06 13:23:42 +11:00
parent 887570065f
commit 5e2b8c43e4
1 changed files with 1 additions and 1 deletions

View File

@ -137,7 +137,7 @@ struct bUnitCollection {
/* Dummy */
static bUnitDef buDummyDef[] = { {"", nullptr, "", nullptr, nullptr, nullptr, 1.0, 0.0}, NULL_UNIT};
static bUnitCollection buDummyCollection = {buDummyDef, 0, 0, sizeof(buDummyDef)};
static bUnitCollection buDummyCollection = {buDummyDef, 0, 0, UNIT_COLLECTION_LENGTH(buDummyDef)};
/* Lengths. */