]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: hq-interop: fix potential NULL dereference
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 18 Nov 2021 13:40:26 +0000 (14:40 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 19 Nov 2021 14:10:46 +0000 (15:10 +0100)
Test return from htx_add_stline() and returns an error if NULL.

src/hq_interop.c

index 0f878f0b25f832a2a4aafc3f8991d30577c1d0a8..075e785b04514adc201894ea30d095f1c16beeb9 100644 (file)
@@ -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);