From: Steven Luo Date: Sun, 30 May 2010 08:51:42 +0000 (-0700) Subject: Command-line utility: avoid NULL dereference when displaying string config settings X-Git-Tag: v3.3b1~3 X-Git-Url: http://git.maemo.org/git/?p=browser-switch;a=commitdiff_plain;h=9ea41db1f7c10a9fafe48dca63e7ee37dcab77a9 Command-line utility: avoid NULL dereference when displaying string config settings --- 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]);