commit 33484cfbd42690a9e980c9f4a7606b62830e1940
Author: Oswald Buddenhagen <o...@kde.org>
Date:   Sat Aug 25 15:34:26 2012 +0200

    don't crash when select() on master fails synchronously
    
    svars->drv[S] would not be initialized yet, so cancel_sync() would
    crash.

 src/sync.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/sync.c b/src/sync.c
index 1503cff..e7f0518 100644
--- a/src/sync.c
+++ b/src/sync.c
@@ -611,6 +611,10 @@ sync_boxes( store_t *ctx[], const char *names[], 
channel_conf_t *chan,
                ctx[t]->uidvalidity = -1;
                set_bad_callback( ctx[t], store_bad, AUX );
                svars->drv[t] = ctx[t]->conf->driver;
+       }
+       /* Both boxes must be fully set up at this point, so that error exit 
paths
+        * don't run into uninitialized variables. */
+       for (t = 0; t < 2; t++) {
                info( "Selecting %s %s...\n", str_ms[t], ctx[t]->name );
                DRIVER_CALL(select( ctx[t], (chan->ops[t] & OP_CREATE) != 0, 
box_selected, AUX ));
        }

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
isync-devel mailing list
isync-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to