diff --git a/0002-curl-7.55.0-32bit-overflow.patch b/0002-curl-7.55.0-32bit-overflow.patch new file mode 100644 index 0000000..f2499b0 --- /dev/null +++ b/0002-curl-7.55.0-32bit-overflow.patch @@ -0,0 +1,26 @@ +From b478816720e1a6b909f454c421dc620e18383947 Mon Sep 17 00:00:00 2001 +From: Kamil Dudka +Date: Wed, 9 Aug 2017 14:27:05 +0200 +Subject: [PATCH] curl: avoid int overflow on arches with 32bit long + +This makes test1427 pass on i386. +--- + src/tool_paramhlp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tool_paramhlp.c b/src/tool_paramhlp.c +index b9dedc9..205c260 100644 +--- a/src/tool_paramhlp.c ++++ b/src/tool_paramhlp.c +@@ -218,7 +218,7 @@ static ParameterError str2double(double *val, const char *str, long max) + num = strtod(str, &endptr); + if(errno == ERANGE) + return PARAM_NUMBER_TOO_LARGE; +- if((long)num > max) { ++ if(num > (double)LONG_MAX || (long)num > max) { + /* too large */ + return PARAM_NUMBER_TOO_LARGE; + } +-- +2.9.4 + diff --git a/curl.spec b/curl.spec index 011ef60..3490632 100644 --- a/curl.spec +++ b/curl.spec @@ -10,6 +10,10 @@ Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz # https://github.com/curl/curl/pull/1744 Patch1: 0001-curl-7.55.0-tests-missing-py-scripts.patch +# avoid int overflow on arches with 32bit long +# https://github.com/curl/curl/pull/1748 +Patch2: 0002-curl-7.55.0-32bit-overflow.patch + # patch making libcurl multilib ready Patch101: 0101-curl-7.32.0-multilib.patch @@ -156,6 +160,9 @@ be installed. %patch1 -p1 chmod +x tests/{dictserver,negtelnetserver}.py +# not yet upstream +%patch2 -p1 + # Fedora patches %patch101 -p1 %patch102 -p1