$OpenBSD: patch-muttlib_c,v 1.3 2010/10/02 01:22:12 sthen Exp $

fix segfault when $message_cachedir is set and opening a POP3 mailbox.
upstream 1a4c43138685, fixes bug#3457

--- muttlib.c.orig	Sat Oct  2 01:51:47 2010
+++ muttlib.c	Sat Oct  2 01:52:34 2010
@@ -1960,6 +1960,7 @@ void mutt_encode_path (char *dest, size_t dlen, const 
 {
   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);
 }
