diff --git a/apr.changes b/apr.changes index d0ccf2b..63946d1 100644 --- a/apr.changes +++ b/apr.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Apr 18 15:33:14 UTC 2018 - mliska@suse.cz + +- Add gcc8-integer-overflow.patch to handle an undefined + behavior (boo#1090085). + ------------------------------------------------------------------- Tue Jan 23 12:26:11 UTC 2018 - normand@linux.vnet.ibm.com diff --git a/apr.spec b/apr.spec index f0a51f7..ef21b5e 100644 --- a/apr.spec +++ b/apr.spec @@ -34,6 +34,7 @@ Patch4: apr-1.4.5-linux3.patch Patch5: apr-visibility.patch Patch6: apr-use-getrandom.patch Patch9: apr-proc-mutex-map-anon.patch +Patch10: gcc8-integer-overflow.patch BuildRequires: doxygen BuildRequires: fdupes BuildRequires: libtool @@ -87,6 +88,7 @@ that want to make use of APR. %patch5 -p1 %patch6 -p1 %patch9 -p1 +%patch10 -p1 # Do not put date to doxy content sed -i \ diff --git a/gcc8-integer-overflow.patch b/gcc8-integer-overflow.patch new file mode 100644 index 0000000..7221d05 --- /dev/null +++ b/gcc8-integer-overflow.patch @@ -0,0 +1,14 @@ +diff --git a/test/teststr.c b/test/teststr.c +index d9a505475..7c945886d 100644 +--- a/test/teststr.c ++++ b/test/teststr.c +@@ -307,7 +307,8 @@ static void overflow_strfsize(abts_case *tc, void *data) + for (; off < 999999999; off += 999) { + apr_strfsize(off, buf); + } +- for (off = 1; off < LONG_MAX && off > 0; off *= 2) { ++ /* Be carefull about integer overflow. */ ++ for (off = 1; off < (LONG_MAX / 4) && off > 0; off *= 2) { + apr_strfsize(off, buf); + apr_strfsize(off + 1, buf); + apr_strfsize(off - 1, buf);