[PATCH 08 of 16] Check imap_parse_path return value
1 file changed, 6 insertions(+), 1 deletion(-)
browser.c | 7 ++++++-
# HG changeset patch
# User Erik Hovland <erik@xxxxxxxxxxx>
# Date 1236896058 25200
# Branch HEAD
# Node ID 11043c209744a060c15ca4db24bc49ae63fd4aea
# Parent d03156127b1d7fae9f44802d1a60f2c5b4ee744a
Check imap_parse_path return value
diff --git a/browser.c b/browser.c
--- a/browser.c
+++ b/browser.c
@@ -924,7 +924,12 @@
IMAP_MBOX mx;
int nentry = menu->current;
- imap_parse_path (state.entry[nentry].name, &mx);
+ if (imap_parse_path (state.entry[nentry].name, &mx) < 0)
+ {
+ mutt_error _("Cannot delete root folder");
+ break;
+ }
+
if (!mx.mbox)
{
mutt_error _("Cannot delete root folder");