Otherwise the code might access some random memory region.
---
src/drv_imap.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/drv_imap.c b/src/drv_imap.c
index abfc760..bf56b6e 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -956,7 +956,8 @@ 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 */
+ l = strlen ( arg );
+ if (l >= 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 );
--
1.8.3.1
------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel