[6.0] c1a72221c vtc: zero the token arrays for each command

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Wed Feb 6 08:40:13 UTC 2019


commit c1a72221cbc5d3e0a32385f8fa19dede6cc53fa4
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 9d4a899d2..c7350df0a 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