Browse Source

Prevent buffer overruns due to oversized INI values

pull/3291/head
staphen 4 years ago committed by Anders Jenbo
parent
commit
048735114b
  1. 3
      Source/options.cpp

3
Source/options.cpp

@ -204,7 +204,8 @@ bool GetIniValue(const char *sectionName, const char *keyName, char *string, int
strncpy(string, defaultString, stringSize);
return false;
}
strncpy(string, value, stringSize);
strncpy(string, value, stringSize - 1);
string[stringSize - 1] = '\0';
return true;
}

Loading…
Cancel
Save