commit 4fa57791930ea07ede9070d3923613b51ed871fc
parent 359091625daefccfa1a957dbfb7536376a4c56fc
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date: Sun, 15 Dec 2013 12:46:03 +0100
avoid array underflow in IMAP LIST .lock workaround
suggested by Mark Wielaard <mark@klomp.org>.
fwiw, the workaround really is still necessary with panda imap ...
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/drv_imap.c b/src/drv_imap.c
@@ -1094,7 +1094,7 @@ parse_list_rsp_p2( imap_store_t *ctx, list_t *list, char *cmd ATTR_UNUSED )
goto skip;
}
}
- if (!memcmp( arg + strlen( arg ) - 5, ".lock", 5 )) /* workaround broken servers */
+ if ((l = strlen( arg )) >= 5 && !memcmp( arg + l - 5, ".lock", 5 )) /* workaround broken servers */
goto skip;
if (map_name( arg, (char **)&narg, offsetof(string_list_t, string), ctx->delimiter, "/") < 0) {
warn( "IMAP warning: ignoring mailbox %s (reserved character '/' in name)\n", arg );