From 3bc5b80ae9075e5d940616553f81e8acdd4bd88f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 30 Oct 2017 01:07:36 +0200 Subject: [PATCH] lib: iostream-pump - Fix crash in iostream_pump_switch_ioloop() if io is NULL This would happen when the pump's ostream is full and it has stopped listening for input. --- src/lib/iostream-pump.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/iostream-pump.c b/src/lib/iostream-pump.c index b725af958d..9a4eb80ba5 100644 --- a/src/lib/iostream-pump.c +++ b/src/lib/iostream-pump.c @@ -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); } -- 2.47.3