1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

ws: server: limit string check length for tokenizer on upgrade

This commit is contained in:
Devin Barillari 2019-07-31 05:08:14 +01:00 committed by Andy Green
parent 431e4e82e1
commit 4e7cefb006

View file

@ -422,7 +422,7 @@ lws_process_ws_upgrade(struct lws *wsi)
e = lws_tokenize(&ts);
switch (e) {
case LWS_TOKZE_TOKEN:
if (!strcasecmp(ts.token, "upgrade"))
if (!strncasecmp(ts.token, "upgrade", ts.token_len))
e = LWS_TOKZE_ENDED;
break;