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

[PATCH 4/5] Correctly initialize buffer in start_put() in http-push.c

From
Mike Hommey <mh@glandium.org>
Date
Dec 10, 2007, 21:36 UTC
Message-ID
<1197322571-25023-4-git-send-email-mh@glandium.org>
In-Reply-To
<1197322571-25023-3-git-send-email-mh@glandium.org>
Brown paper bag fix to avoid random misbehaviour.
Signed-off-by: Mike Hommey <mh@glandium.org>
---
 This is a brown paper bag fix for my strbuf patch for the http code.
 http-push.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/http-push.c b/http-push.c
index 2ef764c..ad8167e 100644
--- a/http-push.c
+++ b/http-push.c
@@ -495,6 +495,7 @@ static void start_put(struct transfer_request *request)
 	deflateInit(&stream, zlib_compression_level);
 	size = deflateBound(&stream, len + hdrlen);
 	strbuf_init(&request->buffer.buf, size);
+	request->buffer.posn = 0;
 
 	/* Compress it */
 	stream.next_out = (unsigned char *)request->buffer.buf.buf;
-- 
1.5.3.7.1159.gdd4a4
Previous: Mike HommeyNext: Mike Hommey
Message 4 of 11 in “Remove the default_headers variable from http-push.c”
  1. 1/5 Remove the default_headers variable from http-push.cMike Hommey, Dec 10, 2007
  2. 2/5 Remove a CURLOPT_HTTPHEADER (un)settingMike Hommey, Dec 10, 2007
  3. 3/5 Avoid redundant declaration of missing_target()Mike Hommey, Dec 10, 2007
  4. 4/5 Correctly initialize buffer in start_put() in http-push.cMike Hommey, Dec 10, 2007
  5. 5/5 Fix various memory leaks in http-push.c and http-walker.cMike Hommey, Dec 10, 2007
  6. 6/5 Move fetch_ref from http-push.c and http-walker.c to http.cMike Hommey, Dec 10, 2007
  7. Junio C HamanoDec 11, 2007
  8. Mike HommeyDec 11, 2007
  9. Andreas EricssonDec 11, 2007
  10. Mike HommeyDec 11, 2007
  11. Move fetch_ref from http-push.c and http-walker.c to http.cMike Hommey, Dec 11, 2007

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.