From: Brendan Cully Date: Sun, 11 Jan 2009 05:43:53 +0000 (-0800) Subject: Guard against NULL pointers in imap_mxcmp X-Git-Tag: mutt-1-5-20-rel~213 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0800e4eb3df7244aff4d86c43488d1f3503dfc83;p=mutt Guard against NULL pointers in imap_mxcmp --- diff --git a/imap/util.c b/imap/util.c index ebf4237f..5aff9bdc 100644 --- a/imap/util.c +++ b/imap/util.c @@ -1,7 +1,7 @@ /* * Copyright (C) 1996-8 Michael R. Elkins * Copyright (C) 1996-9 Brandon Long - * Copyright (C) 1999-2008 Brendan Cully + * Copyright (C) 1999-2009 Brendan Cully * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -270,6 +270,10 @@ int imap_mxcmp (const char* mx1, const char* mx2) char* b2; int rc; + if (!mx1) + return -1; + if (!mx2) + return 1; if (!ascii_strcasecmp (mx1, "INBOX") && !ascii_strcasecmp (mx2, "INBOX")) return 0;