Browse Source

fix: check for EOF instead of truthiness in tag close handling

Tokenizer_read returns TOKENIZER_EOF for end-of-input, not a falsy
value. The old truthiness check let NUL bytes truncate parsing.
pull/358/head
June Kim 5 months ago
parent
commit
158b8967e1
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/mwparserfromhell/parser/ctokenizer/tok_parse.c

+ 1
- 1
src/mwparserfromhell/parser/ctokenizer/tok_parse.c View File

@@ -2988,7 +2988,7 @@ Tokenizer_parse(Tokenizer *self, uint64_t context, int push)
} else if (Tokenizer_emit_char(self, this)) {
return NULL;
}
} else if (this == '<' && next == '/' && Tokenizer_read(self, 2)) {
} else if (this == '<' && next == '/' && Tokenizer_read(self, 2) != TOKENIZER_EOF) {
if (this_context & LC_TAG_BODY ? Tokenizer_handle_tag_open_close(self)
: Tokenizer_handle_invalid_tag_start(self)) {
return NULL;


Loading…
Cancel
Save