mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2024-10-26 20:25:14 +03:00
[CVE-2024-34459] Fix buffer overread with xmllint --htmlout
Add a missing bounds check. Fixes #720.
This commit is contained in:
parent
c83147bff2
commit
3ad7f81624
@ -543,7 +543,7 @@ xmlHTMLPrintFileContext(xmlParserInputPtr input) {
|
||||
len = strlen(buffer);
|
||||
snprintf(&buffer[len], sizeof(buffer) - len, "\n");
|
||||
cur = input->cur;
|
||||
while ((*cur == '\n') || (*cur == '\r'))
|
||||
while ((cur > base) && ((*cur == '\n') || (*cur == '\r')))
|
||||
cur--;
|
||||
n = 0;
|
||||
while ((cur != base) && (n++ < 80)) {
|
||||
|
Loading…
Reference in New Issue
Block a user