Skip to content

Commit 23649d1

Browse files
committed
sapi/was: refuse to send long headers
1 parent d0eaa9c commit 23649d1

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
@@ -141,6 +141,10 @@ static char *sapi_was_getenv(const char *name, size_t name_len)
141141
static bool send_was_header(struct was_simple *w,
142142
const char *data, size_t length)
143143
{
144+
if (length > 0xffff)
145+
/* the WAS protocol is limited by its 16 bit "length" field */
146+
return false;
147+
144148
const char *const end = data + length;
145149
const char *colon = memchr(data, ':', length);
146150
if (colon == NULL || colon == data)

0 commit comments

Comments
 (0)