Petr Gajdos
c74d6562e9
- Add gcc8-integer-overflow.patch to handle an undefined behavior (boo#1090085). OBS-URL: https://build.opensuse.org/request/show/597822 OBS-URL: https://build.opensuse.org/package/show/Apache/apr?expand=0&rev=11
15 lines
558 B
Diff
15 lines
558 B
Diff
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);
|