aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2012-05-29 20:55:22 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2012-05-29 21:00:39 +0200
commitbc7c0be84c31633f1b4903b8ae623f5c1cb9395e (patch)
tree8bca1da0fe1375995d616256c9caa4337e78bac3
parentb5a911421fbacc0e937264919ad4718f2fc4de14 (diff)
downloadcalcurse-bc7c0be84c31633f1b4903b8ae623f5c1cb9395e.tar.gz
calcurse-bc7c0be84c31633f1b4903b8ae623f5c1cb9395e.zip
src/config.c: Bail out on incomplete directive
Fixes a segmentation fault that arose if a line in the configuration file didn't contain a value/key separator ("="). Instead of operating on a NULL pointer, throw an error message containing the erroneous directive and bail out. Reported-by: Baptiste Jonglez <baptiste--git@jonglez.org> Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r--src/config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index edf1f3b..bb6ddf7 100644
--- a/src/config.c
+++ b/src/config.c
@@ -445,6 +445,9 @@ config_file_walk(config_fn_walk_cb_t fn_cb,
*value = '\0';
value++;
}
+ else {
+ EXIT(_("invalid configuration directive: \"%s\""), e_conf);
+ }
if (strcmp(key, "auto_save") == 0 ||
strcmp(key, "auto_gc") == 0 ||