inlines: add explicit bounds check in HTML comment scan. · commonmark/cmark@cb3fe8c · GitHub
Skip to content

Commit cb3fe8c

Browse files
jgmclaude
andcommitted
inlines: add explicit bounds check in HTML comment scan.
The outer condition only guarantees pos+2 <= input.len, but the branches indexed data[pos+3] and data[pos+4]. Correctness relied on the strbuf-backed null terminator and on data[pos+2] == '-' ruling out the terminator. Make the bounds explicit so the code does not depend on those invariants. Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9dc68b8 commit cb3fe8c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/inlines.c‎

Lines changed: 4 additions & 2 deletions

0 commit comments

Comments
 (0)