From 2cb0f74d4fd8ac9da7529933fb87d4e63657dcb6 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 19 Jul 2008 11:44:41 +0000 Subject: [PATCH] Deal appropriately with ParseArgv returning NULL git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2963 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- varnish-cache/bin/varnishd/mgt_param.c | 5 +++++ varnish-cache/bin/varnishd/varnishd.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/varnish-cache/bin/varnishd/mgt_param.c b/varnish-cache/bin/varnishd/mgt_param.c index 416b0d94..f2f8893f 100644 --- a/varnish-cache/bin/varnishd/mgt_param.c +++ b/varnish-cache/bin/varnishd/mgt_param.c @@ -324,6 +324,11 @@ tweak_listen_address(struct cli *cli, const struct parspec *par, const char *arg } av = ParseArgv(arg, 0); + if (av == NULL) { + cli_out(cli, "Parse error: out of memory"); + cli_result(cli, CLIS_PARAM); + return; + } if (av[0] != NULL) { cli_out(cli, "Parse error: %s", av[0]); cli_result(cli, CLIS_PARAM); diff --git a/varnish-cache/bin/varnishd/varnishd.c b/varnish-cache/bin/varnishd/varnishd.c index 5171561e..1b6df279 100644 --- a/varnish-cache/bin/varnishd/varnishd.c +++ b/varnish-cache/bin/varnishd/varnishd.c @@ -115,6 +115,7 @@ setup_storage(const char *spec) int ac; av = ParseArgv(spec, ARGV_COMMA); + AN(av); if (av[0] != NULL) ARGV_ERR("%s\n", av[0]); @@ -153,6 +154,7 @@ setup_hash(const char *h_arg) struct hash_slinger *hp; av = ParseArgv(h_arg, ARGV_COMMA); + AN(av); if (av[0] != NULL) ARGV_ERR("%s\n", av[0]); -- 2.39.5