[master] 1c1a72af3 vtc: zero the token arrays for each command

Nils Goroll nils.goroll at uplex.de
Sat Nov 17 11:25:16 UTC 2018


commit 1c1a72af37c46bc5ba6e5335ad742e541ce268dd
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Sat Nov 17 12:17:18 2018 +0100

    vtc: zero the token arrays for each command
    
    arguments could leak from one vtc command to the next where NULL
    arguments do not necessarily denote the end of arguments, eg. in
    varnish_expect

diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c
index 2ddb98cd3..8a9057333 100644
--- a/bin/varnishtest/vtc.c
+++ b/bin/varnishtest/vtc.c
@@ -339,6 +339,8 @@ parse_string(const char *spec, const struct cmds *cmd, void *priv,
 			vtc_log(vl, 2, "=== %.*s", (int)(q - p), p);
 
 		/* First content on line, collect tokens */
+		memset(token_s, 0, sizeof token_s);
+		memset(token_e, 0, sizeof token_e);
 		tn = 0;
 		f = p;
 		while (p < e) {


More information about the varnish-commit mailing list