mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
sshd: fix NULL vhd protection
This commit is contained in:
parent
79326e4f07
commit
001b3010a6
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),
|
||||
pss->vhd->protocol);
|
||||
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_vhost_name_to_protocol(
|
||||
lws_get_vhost(wsi), "lws-ssh-base"));
|
||||
|
||||
if (!vhd && reason != LWS_CALLBACK_PROTOCOL_INIT)
|
||||
return -1;
|
||||
|
||||
switch ((int)reason) {
|
||||
case LWS_CALLBACK_PROTOCOL_INIT:
|
||||
vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
|
||||
|
|
Loading…
Add table
Reference in a new issue