git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] http-push: workaround for format overflow warning in gcc >= 9

From
Carlo Marcelo Arenas Belón <carenas@gmail.com>
Date
May 10, 2019, 06:58 UTC
Message-ID
<20190510065848.27606-1-carenas@gmail.com>
In function 'finish_request',
    inlined from 'process_response' at http-push.c:248:2:
http-push.c:587:4: warning: '%s' directive argument is null [-Wformat-overflow=]
  587 |    fprintf(stderr, "Unable to get pack file %s\n%s",
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  588 |     request->url, curl_errorstr);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
---
 http-push.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/http-push.c b/http-push.c
index f675a96316..2db553ef38 100644
--- a/http-push.c
+++ b/http-push.c
@@ -585,7 +585,8 @@ static void finish_request(struct transfer_request *request)
 		int fail = 1;
 		if (request->curl_result != CURLE_OK) {
 			fprintf(stderr, "Unable to get pack file %s\n%s",
-				request->url, curl_errorstr);
+				request->url ? request->url : "",
+				curl_errorstr);
 		} else {
 			preq = (struct http_pack_request *)request->userData;
 
-- 
2.21.0
Next: Eric Sunshine
Message 1 of 3 in “http-push: workaround for format overflow warning in gcc >= 9”
  1. http-push: workaround for format overflow warning in gcc >= 9Carlo Marcelo Arenas Belón, May 10, 2019
  2. Eric SunshineMay 10, 2019
  3. Junio C HamanoMay 13, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.