From: Christopher Faulet Date: Wed, 17 Apr 2019 13:08:42 +0000 (+0200) Subject: BUG/MEDIUM: htx: Don't return the start-line if the HTX message is empty X-Git-Tag: v2.0-dev3~246 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3a4d1bea61cb20dd4c00902dfff7a403af19f965;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: htx: Don't return the start-line if the HTX message is empty 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. --- diff --git a/include/common/htx.h b/include/common/htx.h index 9cbc953009..cd7db0526e 100644 --- a/include/common/htx.h +++ b/include/common/htx.h @@ -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;