1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-30 22:43:14 +03:00

Heap-buffer-overflow read of size 1 in xmlFAParsePosCharGroup

Credit to OSS-Fuzz.

Add a check to xmlFAParseCharRange() for the end of the buffer
to prevent reading past the end of it.

This fixes Bug 784017.
This commit is contained in:
David Kilzer
2017-07-04 18:38:03 +02:00
committed by Nick Wellnhofer
parent 8a0c66986e
commit fb56f80eef

View File

@ -5053,7 +5053,7 @@ xmlFAParseCharRange(xmlRegParserCtxtPtr ctxt) {
return; return;
} }
len = 1; len = 1;
} else if ((cur != 0x5B) && (cur != 0x5D)) { } else if ((cur != '\0') && (cur != 0x5B) && (cur != 0x5D)) {
end = CUR_SCHAR(ctxt->cur, len); end = CUR_SCHAR(ctxt->cur, len);
} else { } else {
ERROR("Expecting the end of a char range"); ERROR("Expecting the end of a char range");