diff --git a/lib/handshake.c b/lib/handshake.c index dafccef2..dca2e141 100644 --- a/lib/handshake.c +++ b/lib/handshake.c @@ -619,7 +619,7 @@ libwebsocket_read(struct libwebsocket_context *context, struct libwebsocket *wsi if (wsi->protocol->name == NULL) break; } else - if (strcmp( + if (wsi->protocol->name && strcmp( wsi->utf8_token[WSI_TOKEN_PROTOCOL].token, wsi->protocol->name) == 0) break;