[master] ffe895128 vav: Bound check after moving forward

Dridi Boukelmoune dridi.boukelmoune at gmail.com
Fri Jul 2 16:22:04 UTC 2021


commit ffe8951286d170a6b75903700c454df8262c834f
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Fri Jul 2 11:23:29 2021 +0200

    vav: Bound check after moving forward
    
    There's no longer the guarantee of a null character at the end of a VAV
    string.

diff --git a/lib/libvarnish/vav.c b/lib/libvarnish/vav.c
index c3e91f2dd..53de58fa5 100644
--- a/lib/libvarnish/vav.c
+++ b/lib/libvarnish/vav.c
@@ -190,11 +190,11 @@ VAV_ParseTxt(const char *b, const char *e, int *argc, int flag)
 			}
 			if (*b == '"' && !(flag & ARGV_NOESC))
 				break;
+			b++;
 			if (b >= e) {
 				argv[0] = err_missing_quote;
 				return (argv);
 			}
-			b++;
 		}
 		if (nargv + 1 >= largv) {
 			argv = realloc(argv, sizeof (*argv) * (largv += largv));


More information about the varnish-commit mailing list