From: Amaury Denoyelle Date: Thu, 18 Nov 2021 13:40:26 +0000 (+0100) Subject: BUG/MINOR: hq-interop: fix potential NULL dereference X-Git-Tag: v2.5-dev15~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b48c59a5a37faa01b4855d7abd9f3f0cc423c1da;p=thirdparty%2Fhaproxy.git BUG/MINOR: hq-interop: fix potential NULL dereference Test return from htx_add_stline() and returns an error if NULL. --- diff --git a/src/hq_interop.c b/src/hq_interop.c index 0f878f0b25..075e785b04 100644 --- a/src/hq_interop.c +++ b/src/hq_interop.c @@ -38,6 +38,9 @@ static int hq_interop_decode_qcs(struct qcs *qcs, void *ctx) path.len = ptr - path.ptr; sl = htx_add_stline(htx, HTX_BLK_REQ_SL, 0, ist("GET"), path, ist("HTTP/1.0")); + if (!sl) + return -1; + sl->flags |= HTX_SL_F_BODYLESS; sl->info.req.meth = find_http_meth("GET", 3);