handle unsupported protocol correctly
authorNick Dowell <nick@nickdowell.com>
Tue, 3 Apr 2012 16:22:19 +0000 (17:22 +0100)
committerAndy Green <andy.green@linaro.org>
Wed, 4 Apr 2012 00:27:35 +0000 (08:27 +0800)
commit5519d9f0544264fe71e0badd3d858d8ffbef2431
treee5fc6d0179888a3bbd9c13e13ee4986a64758de1
parent15601fd8f10b9e1b0774235e8a9298c47707f363
handle unsupported protocol correctly

Hi Andy,

First off, thanks for libwebsockets :-)

I've encountered a crash when a client connects to a libwebsockets server
but speicifies an unsupported protocol (Sec-WebSocket-Protocol).
handshake.c should probably be checking that wsi->protocol->name is not
null before doing a strcmp with it...
Attached is a patch for your consideration.

Cheers!
Nick

Signed-off-by: Nick Dowell <nick@nickdowell.com>
lib/handshake.c