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;
|
idx = -idx - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (idx >= MAX_GVARS) {
|
||||||
|
s[0] = '\0';
|
||||||
|
return s;
|
||||||
|
}
|
||||||
|
|
||||||
if (g_model.gvars[idx].name[0])
|
if (g_model.gvars[idx].name[0])
|
||||||
strAppend(s, g_model.gvars[idx].name, LEN_GVAR_NAME);
|
strAppend(s, g_model.gvars[idx].name, LEN_GVAR_NAME);
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user