]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream-int: Check if the conn_stream exist in si_cs_io_cb.
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 21 Aug 2018 13:59:43 +0000 (15:59 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 21 Aug 2018 16:06:54 +0000 (18:06 +0200)
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

index 4b5b760c853b488dc96db36a7cebd668ce00cdff..52aa7c43d15d00284ca9d0a44036c19d7e0a5d66 100644 (file)
@@ -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);
 }