Browse Source

don't crash in message expiration debug print

we would try to print the uids from the non-existing srec of unpaired
messages while preparing expiration.
this would happen only if a) MaxMessages was configured and b) new
messages appeared on the slave but we were not pushing, so it's a bit of
a corner case.

found by coverity.
1.1
Oswald Buddenhagen 11 years ago
parent
commit
c5f2943ff6
  1. 2
      src/sync.c

2
src/sync.c

@ -1360,7 +1360,7 @@ box_loaded( int sts, void *aux )
continue; continue;
if (!(srec = tmsg->srec) || srec->uid[M] <= 0) { if (!(srec = tmsg->srec) || srec->uid[M] <= 0) {
/* We did not push the message, so it must be kept. */ /* We did not push the message, so it must be kept. */
debug( " old pair(%d,%d) unpropagated\n", srec->uid[M], srec->uid[S] ); debug( " message %d unpropagated\n", tmsg->uid );
todel--; todel--;
} else { } else {
nflags = (tmsg->flags | srec->aflags[S]) & ~srec->dflags[S]; nflags = (tmsg->flags | srec->aflags[S]) & ~srec->dflags[S];

Loading…
Cancel
Save