From: Richard Russon Date: Tue, 3 Jul 2018 09:34:07 +0000 (+0100) Subject: prevent buffer underrun X-Git-Tag: neomutt-20180716~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=737c17798bf8555807a883a4346efb8d56704a79;p=neomutt prevent buffer underrun Thanks @l2dy --- diff --git a/muttlib.c b/muttlib.c index 86c7cb3fb..264c5677a 100644 --- a/muttlib.c +++ b/muttlib.c @@ -1482,6 +1482,8 @@ void mutt_get_parent_path(char *output, char *path, size_t olen) { mutt_str_strfcpy(output, path, olen); int n = mutt_str_strlen(output); + if (n == 0) + return; /* remove any final trailing '/' */ if (output[n - 1] == '/')