From a6ff03577017848e1246cbca985060fae97f43b3 Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Tue, 21 Aug 2018 15:59:43 +0200 Subject: [PATCH] BUG/MEDIUM: stream-int: Check if the conn_stream exist in si_cs_io_cb. It is possible that the conn_stream gets detached from the stream_interface, and as it subscribed to the wait list, si_cs_io_cb() gets called anyway, so make sure we have a conn_stream before attempting to send more data. This is 1.9-specific, no backport is needed. --- src/stream_interface.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stream_interface.c b/src/stream_interface.c index 4b5b760c8..52aa7c43d 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -760,8 +760,12 @@ wake_others: struct task *si_cs_io_cb(struct task *t, void *ctx, unsigned short state) { struct stream_interface *si = ctx; + struct conn_stream *cs = objt_cs(si->end); + + if (!cs) + return NULL; if (!(si->wait_list.wait_reason & SUB_CAN_SEND)) - si_cs_send(__objt_cs(si->end)); + si_cs_send(cs); return (NULL); } -- 2.47.3