]> granicus.if.org Git - neomutt/commitdiff
check the buffer in enriched_putwc()
authorRichard Russon <rich@flatcap.org>
Thu, 19 Sep 2019 22:48:48 +0000 (23:48 +0100)
committerRichard Russon <rich@flatcap.org>
Sat, 21 Sep 2019 17:09:23 +0000 (18:09 +0100)
enriched.c

index 018205bc3597681e3b173c8a6b4405d9f3743c65..c728075465e3fb3d39730bf3ad1f1c151c27b930 100644 (file)
@@ -287,7 +287,7 @@ static void enriched_putwc(wchar_t c, struct EnrichedState *stte)
   }
 
   /* see if more space is needed (plus extra for possible rich characters) */
-  if (stte->buf_len < (stte->buf_used + 3))
+  if ((stte->buf_len < (stte->buf_used + 3)) || !stte->buffer)
   {
     stte->buf_len += 1024;
     mutt_mem_realloc(&stte->buffer, (stte->buf_len + 1) * sizeof(wchar_t));