getGVarString: boundary check
This commit is contained in:
committed by
Raphael Coeffic
parent
2350619364
commit
c418758863
@@ -378,6 +378,11 @@ char *getGVarString(char *dest, int idx)
|
||||
idx = -idx - 1;
|
||||
}
|
||||
|
||||
if (idx >= MAX_GVARS) {
|
||||
s[0] = '\0';
|
||||
return s;
|
||||
}
|
||||
|
||||
if (g_model.gvars[idx].name[0])
|
||||
strAppend(s, g_model.gvars[idx].name, LEN_GVAR_NAME);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user