From 4f0a39962003bf88bdba8c611c5a46e3740f8cf7 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Sat, 1 Jun 2019 12:06:02 +0100 Subject: [PATCH] fix buffer handling Coverity: CID 197580, 198376, 198378, 198379 --- mutt/file.c | 2 +- muttlib.c | 4 ++-- pattern.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mutt/file.c b/mutt/file.c index 97063d63c..26270b451 100644 --- a/mutt/file.c +++ b/mutt/file.c @@ -116,7 +116,7 @@ static int mkwrapdir(const char *path, struct Buffer *newfile, struct Buffer *ne goto cleanup; } - mutt_buffer_printf(newfile, "%s/%s", mutt_b2s(newdir), NONULL(basename)); + mutt_buffer_printf(newfile, "%s/%s", newdir->data, NONULL(basename)); cleanup: mutt_buffer_free(&parent); diff --git a/muttlib.c b/muttlib.c index 482eaa079..4f8f3437e 100644 --- a/muttlib.c +++ b/muttlib.c @@ -110,7 +110,7 @@ void mutt_adv_mktemp(struct Buffer *buf) *suffix = '\0'; suffix++; } - mutt_buffer_mktemp_pfx_sfx(buf, mutt_b2s(prefix), suffix); + mutt_buffer_mktemp_pfx_sfx(buf, prefix->data, suffix); out: mutt_buffer_pool_release(&prefix); @@ -233,7 +233,7 @@ void mutt_buffer_expand_path_regex(struct Buffer *buf, bool regex) mutt_email_free(&e); /* Avoid infinite recursion if the resulting folder starts with '@' */ - if (*(mutt_b2s(p)) != '@') + if (*p->data != '@') recurse = true; tail = ""; diff --git a/pattern.c b/pattern.c index e8919c411..64eafecf9 100644 --- a/pattern.c +++ b/pattern.c @@ -2528,7 +2528,7 @@ int mutt_pattern_func(int op, char *prompt) mutt_error(_("No messages matched criteria")); /* record new limit pattern, unless match all */ - const char *pbuf = mutt_b2s(buf); + const char *pbuf = buf->data; while (*pbuf == ' ') pbuf++; if (mutt_str_strcmp(pbuf, "~A") != 0) -- 2.40.0