commit 80402f942dbcb900da33be83f4e87305b22174b4
Author: Oswald Buddenhagen <[email protected]>
Date: Sat Mar 23 10:34:51 2013 +0100
fix crashes in imap_open_store() error paths
it's not a good idea to invoke imap_open_store_bail() twice, either ...
src/drv_imap.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/drv_imap.c b/src/drv_imap.c
index 378c351..c790c41 100644
--- a/src/drv_imap.c
+++ b/src/drv_imap.c
@@ -1322,9 +1322,9 @@ imap_open_store_greeted( imap_store_t *ctx )
static void
imap_open_store_p2( imap_store_t *ctx, struct imap_cmd *cmd ATTR_UNUSED, int
response )
{
- if (response != RESP_OK)
+ if (response == RESP_NO)
imap_open_store_bail( ctx );
- else
+ else if (response == RESP_OK)
imap_open_store_authenticate( ctx );
}
@@ -1363,9 +1363,9 @@ imap_open_store_authenticate( imap_store_t *ctx )
static void
imap_open_store_authenticate_p2( imap_store_t *ctx, struct imap_cmd *cmd
ATTR_UNUSED, int response )
{
- if (response != RESP_OK)
+ if (response == RESP_NO)
imap_open_store_bail( ctx );
- else
+ else if (response == RESP_OK)
socket_start_tls( &ctx->conn, imap_open_store_tlsstarted2 );
}
@@ -1383,9 +1383,9 @@ imap_open_store_tlsstarted2( int ok, void *aux )
static void
imap_open_store_authenticate_p3( imap_store_t *ctx, struct imap_cmd *cmd
ATTR_UNUSED, int response )
{
- if (response != RESP_OK)
+ if (response == RESP_NO)
imap_open_store_bail( ctx );
- else
+ else if (response == RESP_OK)
imap_open_store_authenticate2( ctx );
}
#endif
@@ -1453,9 +1453,9 @@ imap_open_store_authenticate2( imap_store_t *ctx )
static void
imap_open_store_authenticate2_p2( imap_store_t *ctx, struct imap_cmd *cmd
ATTR_UNUSED, int response )
{
- if (response != RESP_OK)
+ if (response == RESP_NO)
imap_open_store_bail( ctx );
- else
+ else if (response == RESP_OK)
imap_open_store_namespace( ctx );
}
@@ -1480,9 +1480,9 @@ imap_open_store_namespace( imap_store_t *ctx )
static void
imap_open_store_namespace_p2( imap_store_t *ctx, struct imap_cmd *cmd
ATTR_UNUSED, int response )
{
- if (response != RESP_OK) {
+ if (response == RESP_NO) {
imap_open_store_bail( ctx );
- } else {
+ } else if (response == RESP_OK) {
ctx->got_namespace = 1;
imap_open_store_namespace2( ctx );
}
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar
_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel