summaryrefslogtreecommitdiffstats
path: root/init.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2003-05-29 17:47:10 +0000
committerThomas Roessler <roessler@does-not-exist.org>2003-05-29 17:47:10 +0000
commitc817e7b9798d11f36df1b2d7ee24c5523275d2b9 (patch)
treea0f3c3dd27cc69f03b0183961d657b399ca42d8c /init.c
parent7f4a9ea59600297ace0542c5e2334bdfc4b7a828 (diff)
Fix a segmentation fault which would occur when pgp_sort_keys is set
in a configuration file, but mutt is compiled without PGP support.
Diffstat (limited to 'init.c')
-rw-r--r--init.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/init.c b/init.c
index 557eb098..ab283524 100644
--- a/init.c
+++ b/init.c
@@ -1173,7 +1173,7 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err)
}
else if (DTYPE (MuttVars[idx].type) == DT_SORT)
{
- const struct mapping_t *map;
+ const struct mapping_t *map = NULL;
switch (MuttVars[idx].type & DT_SUBTYPE_MASK)
{
@@ -1195,6 +1195,13 @@ static int parse_set (BUFFER *tmp, BUFFER *s, unsigned long data, BUFFER *err)
break;
}
+ if (!map)
+ {
+ snprintf (err->data, err->dsize, _("%s: Unknown type."), MuttVars[idx].option);
+ r = -1;
+ break;
+ }
+
if (query || *s->dptr != '=')
{
p = mutt_getnamebyvalue (*((short *) MuttVars[idx].data) & SORT_MASK, map);