From: Richard Russon Date: Fri, 20 Sep 2019 13:08:50 +0000 (+0100) Subject: ensure that the buffer always exists in mutt_buffer_alloc() X-Git-Tag: 2019-10-25~36^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ae2ae99175dce9df69c771daf5bfb228176795b2;p=neomutt ensure that the buffer always exists in mutt_buffer_alloc() --- diff --git a/mutt/buffer.c b/mutt/buffer.c index 12c891a5e..3ab6d6286 100644 --- a/mutt/buffer.c +++ b/mutt/buffer.c @@ -274,7 +274,7 @@ void mutt_buffer_alloc(struct Buffer *buf, size_t new_size) buf->dptr = buf->data; } - if (new_size > buf->dsize) + if ((new_size > buf->dsize) || !buf->data) { size_t offset = (buf->dptr && buf->data) ? buf->dptr - buf->data : 0;