1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-27 04:55:04 +03:00
libxml2/result/XPath/expr
Nick Wellnhofer 30a6533e01 Fix float casts in xmlXPathSubstringFunction
Rewrite conversion of double to int in xmlXPathSubstringFunction, adding
range checks to avoid undefined behavior. Make sure to add start and
length as floating-point numbers before converting to int. Fix a bug
when rounding negative start indices.

Remove unneeded calls to xmlXPathIs{Inf,NaN} and rely on IEEE math
instead. Avoid computing the string length. xmlUTF8Strsub works as
expected if the length of the requested substring exceeds the input.

Found with libFuzzer and UBSan.
2019-03-08 14:29:59 +01:00
..
base Check XPath exponents for overflow 2017-05-31 16:04:37 +02:00
compare more patches from Richard Jinks Updated tests though they show a 2002-03-27 16:12:22 +00:00
equality more patches from Richard Jinks Updated tests though they show a 2002-03-27 16:12:22 +00:00
floats Check for integer overflow in xmlXPathFormatNumber 2017-06-01 22:00:19 +02:00
functions Rework XPath rounding functions 2017-05-31 15:38:42 +02:00
strings Fix float casts in xmlXPathSubstringFunction 2019-03-08 14:29:59 +01:00