From ae2ae99175dce9df69c771daf5bfb228176795b2 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Fri, 20 Sep 2019 14:08:50 +0100 Subject: [PATCH] ensure that the buffer always exists in mutt_buffer_alloc() --- mutt/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.40.0