r2963 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Sat Jul 19 13:44:41 CEST 2008


Author: phk
Date: 2008-07-19 13:44:41 +0200 (Sat, 19 Jul 2008)
New Revision: 2963

Modified:
   trunk/varnish-cache/bin/varnishd/mgt_param.c
   trunk/varnish-cache/bin/varnishd/varnishd.c
Log:
Deal appropriately with ParseArgv returning NULL



Modified: trunk/varnish-cache/bin/varnishd/mgt_param.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_param.c	2008-07-19 11:43:51 UTC (rev 2962)
+++ trunk/varnish-cache/bin/varnishd/mgt_param.c	2008-07-19 11:44:41 UTC (rev 2963)
@@ -324,6 +324,11 @@
 	}
 
 	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);

Modified: trunk/varnish-cache/bin/varnishd/varnishd.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/varnishd.c	2008-07-19 11:43:51 UTC (rev 2962)
+++ trunk/varnish-cache/bin/varnishd/varnishd.c	2008-07-19 11:44:41 UTC (rev 2963)
@@ -115,6 +115,7 @@
 	int ac;
 
 	av = ParseArgv(spec, ARGV_COMMA);
+	AN(av);
 
 	if (av[0] != NULL) 
 		ARGV_ERR("%s\n", av[0]);
@@ -153,6 +154,7 @@
 	struct hash_slinger *hp;
 
 	av = ParseArgv(h_arg, ARGV_COMMA);
+	AN(av);
 
 	if (av[0] != NULL) 
 		ARGV_ERR("%s\n", av[0]);




More information about the varnish-commit mailing list