1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-25 10:50:08 +03:00

buf: Fix return value of xmlBufGetInputBase

Don't return (size_t) -1 in error case.

Found with libFuzzer and -fsanitize=implicit-conversion.
This commit is contained in:
Nick Wellnhofer 2023-01-22 13:49:19 +01:00
parent 74aa61e0bd
commit f8c5e7fb75

2
buf.c
View File

@ -1068,7 +1068,7 @@ xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input) {
size_t base;
if ((input == NULL) || (buf == NULL) || (buf->error))
return(-1);
return(0);
CHECK_COMPAT(buf)
base = input->base - buf->content;
/*