office-gobmx/external/dtoa/ubsan.patch.0
Stephan Bergmann 3820a5c093 ofz#21036: Avoid UBSan signed-integer-overflow in external/dtoa
> workdir/UnpackedTarball/dtoa/src/dtoa.c:3624:12: runtime error: signed integer overflow: 10 * 858993459 cannot be represented in type 'int'
>  #0 in strtod_nolocale at workdir/UnpackedTarball/dtoa/src/dtoa.c:3624:12 (instdir/program/libuno_sal.so.3 +0x55286d)
>  #1 in double (anonymous namespace)::stringToDouble<char16_t>(char16_t const*, char16_t const*, char16_t, char16_t, rtl_math_ConversionStatus*, char16_t const**) at sal/rtl/math.cxx:976:20 (instdir/program/libuno_sal.so.3 +0x3b5f0e)
>  #2 in rtl_math_uStringToDouble at sal/rtl/math.cxx:1028:12 (instdir/program/libuno_sal.so.3 +0x3b1714)
[...]

Change-Id: If24fca1fb4829ddd763c9920a1af9a90dc2b138c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89966
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2020-03-04 16:37:57 +01:00

11 lines
241 B
Text

--- src/dtoa.c
+++ src/dtoa.c
@@ -3618,7 +3618,7 @@
while(c == '0')
c = *++s;
if (c > '0' && c <= '9') {
- L = c - '0';
+ ULong L = c - '0';
s1 = s;
while((c = *++s) >= '0' && c <= '9')
L = 10*L + c - '0';