isync

mailbox synchronization program
git clone https://git.code.sf.net/p/isync/isync
Log | Files | Refs | README | LICENSE

commit 5048521d79342d3e6724a947de5b4a4fac328f13
parent a07be5f175fbf5586ab54ec5c5bd94b7bf43f417
Author: Oswald Buddenhagen <ossi@users.sf.net>
Date:   Wed, 24 Nov 2021 22:33:30 +0100

make sure that all IMAP lists are parsed

... even if we ignore their contents, as they may (hypothetically)
contain literals, which are relevant for the stream syntax.

amends 6fd4e8de2.

Diffstat:
Msrc/drv_imap.c | 11++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/drv_imap.c b/src/drv_imap.c @@ -1028,15 +1028,20 @@ parse_namespace_rsp( imap_store_t *ctx, list_t *list ) return parse_next_list( ctx, parse_namespace_rsp_p2 ); } +// Note that parse_list_rsp() below refers to these as well. static int -parse_namespace_rsp_p2( imap_store_t *ctx, list_t *list ATTR_UNUSED ) +parse_namespace_rsp_p2( imap_store_t *ctx, list_t *list ) { + if (!list) + return parse_list_perror( ctx ); return parse_next_list( ctx, parse_namespace_rsp_p3 ); } static int -parse_namespace_rsp_p3( imap_store_t *ctx ATTR_UNUSED, list_t *list ATTR_UNUSED ) +parse_namespace_rsp_p3( imap_store_t *ctx, list_t *list ) { + if (!list) + return parse_list_perror( ctx ); return LIST_OK; } @@ -1378,7 +1383,7 @@ parse_list_rsp( imap_store_t *ctx, list_t *list ) return parse_list_perror( ctx ); for (lp = list->child; lp; lp = lp->next) if (is_atom( lp ) && !strcasecmp( lp->val, "\\NoSelect" )) - return LIST_OK; + return parse_next_list( ctx, parse_namespace_rsp_p2 ); // (sic!) return parse_next_list( ctx, parse_list_rsp_p1 ); }