mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
parse.y: empty here-doc delimiter caused infinite loop; fix #5676
This commit is contained in:
committed by
mimaki
parent
c627e3b2ab
commit
eaadc5e79f
@@ -4856,7 +4856,7 @@ parse_string(parser_state *p)
|
||||
--len;
|
||||
}
|
||||
}
|
||||
if ((len-1 == hinf->term_len) && (strncmp(s, hinf->term, len-1) == 0)) {
|
||||
if (hinf->term_len > 0 && len-1 == hinf->term_len && strncmp(s, hinf->term, len-1) == 0) {
|
||||
heredoc_remove_indent(p, hinf);
|
||||
return tHEREDOC_END;
|
||||
}
|
||||
|
||||
@@ -11087,7 +11087,7 @@ parse_string(parser_state *p)
|
||||
--len;
|
||||
}
|
||||
}
|
||||
if ((len-1 == hinf->term_len) && (strncmp(s, hinf->term, len-1) == 0)) {
|
||||
if (hinf->term_len > 0 && len-1 == hinf->term_len && strncmp(s, hinf->term, len-1) == 0) {
|
||||
heredoc_remove_indent(p, hinf);
|
||||
return tHEREDOC_END;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user