comparison src/share/vm/runtime/arguments.cpp @ 6901:fe4a4ea5bed9

7158804: Improve config file parsing Summary: Check buffer length when reading Reviewed-by: dholmes, dcubed
author kamg
date Fri, 08 Jun 2012 12:49:12 -0400
parents 84e198dc2474
children 6b5a3d18fe0e
comparison
equal deleted inserted replaced
6900:bf14ed159fb0 6901:fe4a4ea5bed9
858 bool in_quote = false; 858 bool in_quote = false;
859 char quote_c = 0; 859 char quote_c = 0;
860 bool result = true; 860 bool result = true;
861 861
862 int c = getc(stream); 862 int c = getc(stream);
863 while(c != EOF) { 863 while(c != EOF && pos < (int)(sizeof(token)-1)) {
864 if (in_white_space) { 864 if (in_white_space) {
865 if (in_comment) { 865 if (in_comment) {
866 if (c == '\n') in_comment = false; 866 if (c == '\n') in_comment = false;
867 } else { 867 } else {
868 if (c == '#') in_comment = true; 868 if (c == '#') in_comment = true;