mirror of
https://github.com/kevinbentley/Descent3.git
synced 2025-01-22 11:28:56 +00:00
dedicated: resolve out-of-bounds access during config parse
ASAN reports: $GIT/Descent3/dedicated_server.cpp:350:24: runtime error: index 1024 out of bounds for type 'cvar_entry [36]' $GIT/Descent3/dedicated_server.cpp:350:14: runtime error: load of address 0x000001e677c0 with insufficient space for an object of type 'const char *' This can happen if a line in the .cfg starts with a '#'.
This commit is contained in:
parent
6ad7a3d5cb
commit
dfa0560aff
@ -346,7 +346,8 @@ int LoadServerConfigFile() {
|
||||
while (inf.ReadLine()) {
|
||||
int cmd;
|
||||
|
||||
while ((cmd = inf.ParseLine(operand, INFFILE_LINELEN)) > INFFILE_ERROR) {
|
||||
while ((cmd = inf.ParseLine(operand, INFFILE_LINELEN)) > INFFILE_ERROR &&
|
||||
cmd != INFFILE_SYMBOL) {
|
||||
SetCVar(CVars[cmd].varname, operand, true);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user