[master] a50c99f Make sure hp->body is always initialized.

Poul-Henning Kamp phk at FreeBSD.org
Tue Mar 29 09:31:03 CEST 2016


commit a50c99f6b3883d1a58cedfe26511bfc0d30d50bb
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Mar 29 07:30:34 2016 +0000

    Make sure hp->body is always initialized.

diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index f6a08d4..9d1fe34 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -503,7 +503,6 @@ http_swallow_body(struct http *hp, char * const *hh, int body)
 	char *p;
 	int i, l, ll;
 
-	hp->body = hp->rxbuf + hp->prxbuf;
 	ll = 0;
 	p = http_find_header(hh, "transfer-encoding");
 	if (p != NULL && !strcasecmp(p, "chunked")) {
@@ -565,6 +564,7 @@ http_rxhdr(struct http *hp)
 	}
 	vtc_dump(hp->vl, 4, "rxhdr", hp->rxbuf, -1);
 	vtc_log(hp->vl, 4, "rxhdrlen = %zd", strlen(hp->rxbuf));
+	hp->body = hp->rxbuf + hp->prxbuf;
 }
 
 



More information about the varnish-commit mailing list