]> granicus.if.org Git - mutt/commitdiff
fix segfault when $message_cachedir is set and opening a POP3 mailbox.
authorMichael Elkins <me@sigpipe.org>
Fri, 1 Oct 2010 14:14:24 +0000 (07:14 -0700)
committerMichael Elkins <me@sigpipe.org>
Fri, 1 Oct 2010 14:14:24 +0000 (07:14 -0700)
fixes #3457

muttlib.c

index 2160ceb46dbb61918a15cb12dc688316a333d240..2d01599d6654a0478d5bc4ec584e8ac6b63ab4cd 100644 (file)
--- a/muttlib.c
+++ b/muttlib.c
@@ -1960,6 +1960,7 @@ void mutt_encode_path (char *dest, size_t dlen, const char *src)
 {
   char *p = safe_strdup (src);
   int rc = mutt_convert_string (&p, Charset, "utf-8", 0);
-  strfcpy (dest, rc == 0 ? p : src, dlen);
+  /* `src' may be NULL, such as when called from the pop3 driver. */
+  strfcpy (dest, (rc == 0) ? NONULL(p) : NONULL(src), dlen);
   FREE (&p);
 }