Configuration: fixed comments parsing.
Unclosed multi-line comments and "/" at the end of JSON shouldn't be allowed.
This commit is contained in:
@@ -1269,6 +1269,7 @@ nxt_conf_json_skip_space(u_char *start, u_char *end)
|
|||||||
case '\r':
|
case '\r':
|
||||||
continue;
|
continue;
|
||||||
case '/':
|
case '/':
|
||||||
|
start = p;
|
||||||
state = sw_after_slash;
|
state = sw_after_slash;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1285,7 +1286,6 @@ nxt_conf_json_skip_space(u_char *start, u_char *end)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
p--;
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case sw_single_comment:
|
case sw_single_comment:
|
||||||
@@ -1318,6 +1318,10 @@ nxt_conf_json_skip_space(u_char *start, u_char *end)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nxt_slow_path(state != sw_normal)) {
|
||||||
|
return start;
|
||||||
|
}
|
||||||
|
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user