7158804: Improve config file parsing

Check buffer length when reading

Reviewed-by: dholmes, dcubed
This commit is contained in:
Keith McGuigan 2012-06-08 12:49:12 -04:00
parent 0a84e90eea
commit c39971d4f1
3 changed files with 33 additions and 3 deletions

View file

@ -860,7 +860,7 @@ bool Arguments::process_settings_file(const char* file_name, bool should_exist,
bool result = true;
int c = getc(stream);
while(c != EOF) {
while(c != EOF && pos < (int)(sizeof(token)-1)) {
if (in_white_space) {
if (in_comment) {
if (c == '\n') in_comment = false;