projects
/
browser-switch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Command-line utility: avoid NULL dereference when displaying string config settings
[browser-switch]
/
config-ui
/
browser-switchboard-config.c
diff --git
a/config-ui/browser-switchboard-config.c
b/config-ui/browser-switchboard-config.c
index
befc113
..
ec1e509
100644
(file)
--- 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:
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]);
break;
case SWB_CONFIG_OPT_INT:
printf("%d\n", *(int *)cfg.entries[i]);