]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: htx: Don't return the start-line if the HTX message is empty
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 Apr 2019 13:08:42 +0000 (15:08 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 17 Apr 2019 13:12:27 +0000 (15:12 +0200)
In the function htx_get_stline(), NULL must be returned if the HTX message
doesn't contain any element.

This patch must be backported to 1.9.

include/common/htx.h

index 9cbc9530098d8262622dce8dc441adce191eeae0..cd7db0526e48120ff023d2be448a10fb1d54e79a 100644 (file)
@@ -280,7 +280,7 @@ static inline struct htx_sl *htx_get_stline(struct htx *htx)
 {
        struct htx_sl *sl = NULL;
 
-       if (htx->sl_off != -1)
+       if (htx->used && htx->sl_off != -1)
                sl = ((void *)htx->blocks + htx->sl_off);
 
        return sl;