From 9ea41db1f7c10a9fafe48dca63e7ee37dcab77a9 Mon Sep 17 00:00:00 2001 From: Steven Luo Date: Sun, 30 May 2010 01:51:42 -0700 Subject: [PATCH 1/1] Command-line utility: avoid NULL dereference when displaying string config settings --- config-ui/browser-switchboard-config.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config-ui/browser-switchboard-config.c b/config-ui/browser-switchboard-config.c index befc113..ec1e509 100644 --- a/config-ui/browser-switchboard-config.c +++ b/config-ui/browser-switchboard-config.c @@ -49,7 +49,8 @@ static int get_config_value(char *name) { i = optinfo - swb_config_options; switch (optinfo->type) { case SWB_CONFIG_OPT_STRING: - printf("%s\n", *(char **)cfg.entries[i]); + if (*(char **)cfg.entries[i]) + printf("%s\n", *(char **)cfg.entries[i]); break; case SWB_CONFIG_OPT_INT: printf("%d\n", *(int *)cfg.entries[i]); -- 1.7.9.5