Commit 3e68861b authored by Tollef Fog Heen's avatar Tollef Fog Heen

Don't segfault on purge.hash() with NULL string. Fixes #307.


git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3163 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 0235d7c3
......@@ -336,22 +336,26 @@ parse_unset(struct tokenlist *tl)
static void
parse_purge_url(struct tokenlist *tl)
{
struct var *vp;
vcc_NextToken(tl);
Fb(tl, 1, "VRT_purge(");
Expect(tl, '(');
vcc_NextToken(tl);
if (!vcc_StringVal(tl)) {
vp = vcc_FindVar(tl, tl->t, vcc_vars);
ERRCHK(tl);
assert(vp != NULL);
if (vp->fmt != STRING) {
vcc_ExpectedStringval(tl);
return;
}
Fb(tl, 1, "if (%s) VRT_purge(%s, 0);\n", vp->rname, vp->rname);
vcc_NextToken(tl);
Expect(tl, ')');
vcc_NextToken(tl);
Fb(tl, 0, ", 0);\n");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment