mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-16 00:00:07 +01:00
sshd: fix NULL vhd protection
This commit is contained in:
parent
df0f8341dd
commit
c890b6f1b5
1 changed files with 2 additions and 4 deletions
|
@ -2045,14 +2045,12 @@ lws_callback_raw_sshd(struct lws *wsi, enum lws_callback_reasons reason,
|
||||||
lws_protocol_vh_priv_get(lws_get_vhost(wsi),
|
lws_protocol_vh_priv_get(lws_get_vhost(wsi),
|
||||||
pss->vhd->protocol);
|
pss->vhd->protocol);
|
||||||
else
|
else
|
||||||
vhd = (struct per_vhost_data__sshd *)
|
if (lws_get_vhost(wsi))
|
||||||
|
vhd = (struct per_vhost_data__sshd *)
|
||||||
lws_protocol_vh_priv_get(lws_get_vhost(wsi),
|
lws_protocol_vh_priv_get(lws_get_vhost(wsi),
|
||||||
lws_vhost_name_to_protocol(
|
lws_vhost_name_to_protocol(
|
||||||
lws_get_vhost(wsi), "lws-ssh-base"));
|
lws_get_vhost(wsi), "lws-ssh-base"));
|
||||||
|
|
||||||
if (!vhd && reason != LWS_CALLBACK_PROTOCOL_INIT)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
switch ((int)reason) {
|
switch ((int)reason) {
|
||||||
case LWS_CALLBACK_PROTOCOL_INIT:
|
case LWS_CALLBACK_PROTOCOL_INIT:
|
||||||
vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
|
vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
|
||||||
|
|
Loading…
Add table
Reference in a new issue