[master] 3207f0dad vtest: handle empty headers when reading the response
Nils Goroll
nils.goroll at uplex.de
Wed Feb 27 10:32:07 UTC 2019
commit 3207f0dad2212b02468e417ba3f39cc9e951df53
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Wed Feb 27 11:19:45 2019 +0100
vtest: handle empty headers when reading the response
vtest would segfault due to a null pointer access on empty
headers
diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index d0e6921da..349eb596b 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -706,6 +706,8 @@ cmd_http_rxresp(CMD_ARGS)
"Multiple Content-Length headers.\n");
if (!has_obj)
return;
+ if (!hp->resp[0] || !hp->resp[1])
+ return;
else if (!strcmp(hp->resp[1], "200"))
http_swallow_body(hp, hp->resp, 1, 0);
else
More information about the varnish-commit
mailing list