Skip to content

Commit 06b7ec3

Browse files
committed
sapi/was: refuse to send long headers
1 parent 1e7ef11 commit 06b7ec3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sapi/was/was_main.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ static char *sapi_was_getenv(const char *name, size_t name_len)
142142
static bool send_was_header(struct was_simple *w,
143143
const char *data, size_t length)
144144
{
145+
if (length > 0xffff)
146+
/* the WAS protocol is limited by its 16 bit "length" field */
147+
return false;
148+
145149
const char *const end = data + length;
146150
const char *colon = memchr(data, ':', length);
147151
if (colon == NULL || colon == data)

0 commit comments

Comments
 (0)