Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit 2876ac5

Browse files
committed
[CVE-2024-34459] Fix buffer overread with xmllint --htmlout
Add a missing bounds check.
1 parent 8e9fdc2 commit 2876ac5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

xmllint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ xmlHTMLPrintFileContext(xmlParserInputPtr input) {
560560
len = strlen(buffer);
561561
snprintf(&buffer[len], sizeof(buffer) - len, "\n");
562562
cur = input->cur;
563-
while ((*cur == '\n') || (*cur == '\r'))
563+
while ((cur > base) && ((*cur == '\n') || (*cur == '\r')))
564564
cur--;
565565
n = 0;
566566
while ((cur != base) && (n++ < 80)) {

0 commit comments

Comments
 (0)