security: add a NULL pointer check to fix a server crash
based on 7d58aac24f
This commit is contained in:
parent
666c732085
commit
4799e1742c
@ -642,7 +642,8 @@ boolean rdp_decrypt(rdpRdp* rdp, STREAM* s, int length, uint16 securityFlags)
|
||||
|
||||
stream_read(s, wmac, sizeof(wmac));
|
||||
length -= sizeof(wmac);
|
||||
security_decrypt(s->p, length, rdp);
|
||||
if (!security_decrypt(s->p, length, rdp))
|
||||
return false;
|
||||
if (securityFlags & SEC_SECURE_CHECKSUM)
|
||||
security_salted_mac_signature(rdp, s->p, length, false, cmac);
|
||||
else
|
||||
|
@ -475,6 +475,9 @@ boolean security_encrypt(uint8* data, int length, rdpRdp* rdp)
|
||||
|
||||
boolean security_decrypt(uint8* data, int length, rdpRdp* rdp)
|
||||
{
|
||||
if (rdp->decrypt_key == NULL)
|
||||
return false;
|
||||
|
||||
if (rdp->decrypt_use_count >= 4096)
|
||||
{
|
||||
security_key_update(rdp->decrypt_key, rdp->decrypt_update_key, rdp->rc4_key_len);
|
||||
|
Loading…
Reference in New Issue
Block a user