]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: iostream-pump - Fix crash in iostream_pump_switch_ioloop() if io is NULL
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 29 Oct 2017 23:07:36 +0000 (01:07 +0200)
committerTimo Sirainen <tss@dovecot.fi>
Wed, 1 Nov 2017 00:23:31 +0000 (02:23 +0200)
This would happen when the pump's ostream is full and it has stopped
listening for input.

src/lib/iostream-pump.c

index b725af958d5b333ae7a854dc4df899ad377b5cc1..9a4eb80ba56f793178cee06c3a71d8cdd1d26994 100644 (file)
@@ -176,7 +176,8 @@ void iostream_pump_stop(struct iostream_pump *pump)
 void iostream_pump_switch_ioloop(struct iostream_pump *pump)
 {
        i_assert(pump != NULL);
-       pump->io = io_loop_move_io(&pump->io);
+       if (pump->io != NULL)
+               pump->io = io_loop_move_io(&pump->io);
        o_stream_switch_ioloop(pump->output);
        i_stream_switch_ioloop(pump->input);
 }