Skip to content

Commit

Permalink
sapi/was: refuse to send long headers
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Nov 29, 2024
1 parent cc3890a commit e5e075c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sapi/was/was_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ static char *sapi_was_getenv(const char *name, size_t name_len)
static bool send_was_header(struct was_simple *w,
const char *data, size_t length)
{
if (length > 0xffff)
/* the WAS protocol is limited by its 16 bit "length" field */
return false;

const char *const end = data + length;
const char *colon = memchr(data, ':', length);
if (colon == NULL || colon == data)
Expand Down

0 comments on commit e5e075c

Please sign in to comment.