]> granicus.if.org Git - neomutt/commitdiff
fix rfc2047 field decoding
authorRichard Russon <rich@flatcap.org>
Tue, 30 Jan 2018 22:34:03 +0000 (22:34 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 1 Feb 2018 12:08:11 +0000 (12:08 +0000)
mutt/rfc2047.c

index 65c07b30e349da2ca44addd97831179dc3d66707..3f91f2a54bb0bef27a1121ecd66e86c8cb4ff684 100644 (file)
@@ -658,6 +658,9 @@ void mutt_rfc2047_encode(char **pd, const char *specials, int col, const char *c
  */
 void mutt_rfc2047_decode(char **pd)
 {
+  if (!pd || !*pd)
+    return;
+
   struct Buffer buf = { 0 }; /* Output buffer                          */
   char *s = *pd;             /* Read pointer                           */
   char *beg;                 /* Begin of encoded word                  */
@@ -745,5 +748,4 @@ void mutt_rfc2047_decode(char **pd)
 
   mutt_buffer_addch(&buf, '\0');
   *pd = buf.data;
-  return;
 }