]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stream: Don't dereference s->txn when it is not there yet.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 6 Dec 2018 12:28:30 +0000 (13:28 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 6 Dec 2018 14:02:25 +0000 (15:02 +0100)
Test if s->txn is non-NULL before attempting to dereference it, it was lost
during the transition to HTX.

src/stream.c

index be58e77bd663fa17bc732a0d30723047ed5b8377..805fe4d509c5633cb1d38b3a7c0b5fc5d75380e9 100644 (file)
@@ -2204,7 +2204,8 @@ redo:
                         * we simply reset msg->sov so that HTTP rewinding points to the
                         * headers.
                         */
-                       s->txn->req.sov = s->txn->req.eoh + s->txn->req.eol - co_data(req);
+                       if (s->txn)
+                               s->txn->req.sov = s->txn->req.eoh + s->txn->req.eol - co_data(req);
                }
        }
 
@@ -2374,7 +2375,8 @@ redo:
                         * we simply reset msg->sov so that HTTP rewinding points to the
                         * headers.
                         */
-                       s->txn->rsp.sov = s->txn->rsp.eoh + s->txn->rsp.eol - co_data(res);
+                       if (s->txn)
+                               s->txn->rsp.sov = s->txn->rsp.eoh + s->txn->rsp.eol - co_data(res);
                }
 
                /* if we have no analyser anymore in any direction and have a