From 3161540ab9d4702809b9bf90a2fb39db1f3a7c9c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Sat, 8 Feb 2014 13:21:28 +0100 Subject: [PATCH] fix crash on store without prior fetch with non-UIDPLUS servers we'd never initialize the message list append pointer, so imap_find_new_msgs()'s FETCH would go awry. REFMAIL: <20140207101719.GB17125@mac.home> --- src/drv_imap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drv_imap.c b/src/drv_imap.c index 6007e54..fbb8817 100644 --- a/src/drv_imap.c +++ b/src/drv_imap.c @@ -1818,6 +1818,7 @@ imap_select( store_t *gctx, int create, free_generic_messages( gctx->msgs ); gctx->msgs = 0; + ctx->msgapp = &gctx->msgs; if (prepare_box( &buf, ctx ) < 0) { cb( DRV_BOX_BAD, aux ); @@ -1852,7 +1853,6 @@ imap_load( store_t *gctx, int minuid, int maxuid, int newuid, int *excs, int nex } else { struct imap_cmd_refcounted_state *sts = imap_refcounted_new_state( cb, aux ); - ctx->msgapp = &ctx->gen.msgs; sort_ints( excs, nexcs ); for (i = 0; i < nexcs; ) { for (bl = 0; i < nexcs && bl < 960; i++) {