提交 e9a3abf2 编写于 作者: K kvn

7158801: Improve VM CompileOnly option

Summary: Fixed buffer overflow during parsing flags -XX:CompileCommand=, -XX:CompileOnly= and command lines in .hotspot_compiler file.
Reviewed-by: never
上级 500699a8
......@@ -572,7 +572,7 @@ void CompilerOracle::parse_from_file() {
char token[1024];
int pos = 0;
int c = getc(stream);
while(c != EOF) {
while(c != EOF && pos < (sizeof(token)-1)) {
if (c == '\n') {
token[pos++] = '\0';
parse_from_line(token);
......@@ -593,7 +593,7 @@ void CompilerOracle::parse_from_string(const char* str, void (*parse_line)(char*
int pos = 0;
const char* sp = str;
int c = *sp++;
while (c != '\0') {
while (c != '\0' && pos < (sizeof(token)-1)) {
if (c == '\n') {
token[pos++] = '\0';
parse_line(token);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册