]> err.no Git - varnish/commitdiff
Stop segfaulting when trying to set a nonexistant waiter
authortfheen <tfheen@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 25 Feb 2009 10:25:43 +0000 (10:25 +0000)
committertfheen <tfheen@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Wed, 25 Feb 2009 10:25:43 +0000 (10:25 +0000)
We failed to properly check for the end of the list of waiters.
Handle this correctly and add a test case

Fixes #428

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3825 d4fa192b-c00b-0410-8231-f00ffab90ce4

varnish-cache/bin/varnishd/cache_acceptor.c
varnish-cache/bin/varnishtest/tests/b00008.vtc

index 28a6a43f02468a7613fa6c7ef02540d5c5d84591..1d822eaa223407c5010c3d88c3a91ee3455a6ed2 100644 (file)
@@ -368,7 +368,7 @@ VCA_tweak_waiter(struct cli *cli, const char *arg)
                vca_act = NULL;
                return;
        }
-       for (i = 0; vca_waiters[i]->name; i++) {
+       for (i = 0; vca_waiters[i]; i++) {
                if (!strcmp(arg, vca_waiters[i]->name)) {
                        vca_act = vca_waiters[i];
                        return;
index baf36fbca1fe9eb14ac3983be10ace1aaeb446c2..e883ed749c3e642b56a7b035e2e266b1acb29e54 100644 (file)
@@ -19,3 +19,7 @@ varnish v1 -start
 varnish v1 -cliok "help"
 
 varnish v1 -cliok "stats"
+
+varnish v1 -cliok "param.set waiter default"
+
+varnish v1 -clierr 106 "param.set waiter HASH(0x8839c4c)"