BUG/MINOR: h2: ":path" must not be empty

As reported by h2spec, the h2->h1 gateway doesn't verify that ":path"
is not empty. This is harmless since the H1 parser will reject such a
request, but better fix it anyway.

To backport to 1.8.
This commit is contained in:
Willy Tarreau 2017-12-03 11:51:31 +01:00
parent 9470d2cd35
commit cd4fe17a26

View File

@ -83,6 +83,10 @@ static int h2_prepare_h1_reqline(uint32_t fields, struct ist *phdr, char **ptr,
}
}
/* 7540#8.1.2.3: :path must not be empty */
if (!phdr[uri_idx].len)
goto fail;
if (out + phdr[H2_PHDR_IDX_METH].len + 1 + phdr[uri_idx].len + 11 > end) {
/* too large */
goto fail;