From: Mark Wielaard Date: Wed, 13 May 2026 13:57:57 +0000 (+0200) Subject: debuginfod-client: Use CURLOPT_MAXREDIRS X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=882739dbfeacc1d2170157f51112a9cc4d148f38;p=thirdparty%2Felfutils.git debuginfod-client: Use CURLOPT_MAXREDIRS Guard against bad servers. Older libcurl allowed unlimited redirects. Newer libcurl default to max 30. Explicitly set CURLOPT_MAXREDIRS to 6 (twice the number of redirects that seems "reasonable"). This guards against badly setup servers that keep redirecting. https://curl.se/libcurl/c/CURLOPT_MAXREDIRS.html * debuginfod/debuginfod-client.c (init_handle): Add CURLOPT_MAXREDIRS curl_easy_setopt_ck. Signed-off-by: Mark Wielaard --- diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c index fb9ad82f..6340c8c2 100644 --- a/debuginfod/debuginfod-client.c +++ b/debuginfod/debuginfod-client.c @@ -1008,6 +1008,7 @@ init_handle(debuginfod_client *client, } curl_easy_setopt_ck(data->handle, CURLOPT_FILETIME, (long) 1); curl_easy_setopt_ck(data->handle, CURLOPT_FOLLOWLOCATION, (long) 1); + curl_easy_setopt_ck(data->handle, CURLOPT_MAXREDIRS, (long) 6); curl_easy_setopt_ck(data->handle, CURLOPT_FAILONERROR, (long) 1); curl_easy_setopt_ck(data->handle, CURLOPT_NOSIGNAL, (long) 1); if (h_callback)