bind protocol: fix for NULL names

This commit is contained in:
Silas Parker 2017-04-07 18:22:54 +08:00 committed by Andy Green
parent 4adf590e71
commit b4b3da06a1

View file

@ -200,7 +200,7 @@ lws_bind_protocol(struct lws *wsi, const struct lws_protocols *p)
vpo = vp;
while (n--) {
if (!strcmp(p->name, vp->name)) {
if (p->name && vp->name && !strcmp(p->name, vp->name)) {
hit = 1;
lws_same_vh_protocol_insert(wsi, vp - vpo);
break;