From: Michael Tremer Date: Mon, 25 Sep 2023 17:17:06 +0000 (+0000) Subject: downloader: Fix cURL logging X-Git-Tag: 0.9.30~1642 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3354f17777523fabcb3c9d4dbbc22c2d3693adbe;p=pakfire.git downloader: Fix cURL logging Log lines are not NULL-terminated and so we should not read further than indicated. Signed-off-by: Michael Tremer --- diff --git a/src/libpakfire/downloader.c b/src/libpakfire/downloader.c index 38fad822b..efa823bad 100644 --- a/src/libpakfire/downloader.c +++ b/src/libpakfire/downloader.c @@ -236,16 +236,16 @@ static int debug_callback(CURL *handle, curl_infotype type, switch (type) { case CURLINFO_TEXT: - DEBUG(pakfire, "cURL: %s", data); + DEBUG(pakfire, "cURL: %.*s", (int)size, data); break; // Log headers case CURLINFO_HEADER_IN: - DEBUG(pakfire, "cURL: < %s", data); + DEBUG(pakfire, "cURL: < %.*s", (int)size, data); break; case CURLINFO_HEADER_OUT: - DEBUG(pakfire, "cURL: > %s", data); + DEBUG(pakfire, "cURL: > %.*s", (int)size, data); break; // Ignore everything else