diff 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
line wrap: on
line diff
--- a/src/share/vm/runtime/arguments.cpp	Wed May 23 12:11:25 2012 -0700
+++ b/src/share/vm/runtime/arguments.cpp	Fri Jun 08 12:49:12 2012 -0400
@@ -860,7 +860,7 @@
   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;