Thread (6 messages) flat view 6 messages, 1 author, 2016-06-15
DORMANTno replies

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

From: Mike Hommey <hidden>
Date: 2016-06-15 22:43:57
Subsystem: the rest · Maintainer: Linus Torvalds

Brown paper bag fix to avoid random misbehaviour.

Signed-off-by: Mike Hommey <redacted>
---

 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help