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.
This commit is contained in:
Christopher Faulet 2019-04-17 15:08:42 +02:00
parent 038ad8123b
commit 3a4d1bea61
1 changed files with 1 additions and 1 deletions

View 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;