Skip to content

Commit 45057f3

Browse files
committed
Address "CVE-2022-32221" in the bundled curl library (v7.69).
The patch is applied during the CMake preparation step, before compiling the bundled curl source code. Closes davix cern-fts#102
1 parent dfb83ef commit 45057f3

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

cmake/modules/buildCurl.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ macro(buildCurl)
1010
SOURCE_DIR "${CMAKE_SOURCE_DIR}/deps/curl"
1111
BINARY_DIR "${CMAKE_BINARY_DIR}/deps/curl"
1212
PREFIX "${CMAKE_BINARY_DIR}/deps/curl"
13+
PATCH_COMMAND bash -c "git checkout -q lib/setopt.c && set -x && git apply ${CMAKE_SOURCE_DIR}/curl-CVE-2022-32221.patch"
1314
CONFIGURE_COMMAND bash -c "${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=/usr/ -DCMAKE_INSTALL_LIBDIR=lib -DHTTP_ONLY=ON -DBUILD_CURL_EXE=OFF -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=OFF -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_USE_LIBSSH2=OFF ${SECURE_TRANSPORT_FLAGS} ${CMAKE_SOURCE_DIR}/deps/curl && ${CMAKE_SOURCE_DIR}/patch-curl-clock-gettime.sh"
1415
BUILD_COMMAND make
1516
INSTALL_COMMAND make DESTDIR=${CMAKE_BINARY_DIR}/deps/curl-install install

curl-CVE-2022-32221.patch

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/lib/setopt.c b/lib/setopt.c
2+
index 2e494a6df..e64dc23a3 100644
3+
--- a/lib/setopt.c
4+
+++ b/lib/setopt.c
5+
@@ -486,6 +486,7 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
6+
}
7+
else
8+
data->set.httpreq = HTTPREQ_GET;
9+
+ data->set.upload = FALSE;
10+
break;
11+
12+
case CURLOPT_COPYPOSTFIELDS:

0 commit comments

Comments
 (0)