Skip to content
Permalink
Browse files Browse the repository at this point in the history
security: add a NULL pointer check to fix a server crash.
  • Loading branch information
Vic Lee committed Mar 5, 2013
1 parent 03fd416 commit 7d58aac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libfreerdp/core/rdp.c
Expand Up @@ -717,7 +717,8 @@ BOOL 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);
Expand Down
2 changes: 2 additions & 0 deletions libfreerdp/core/security.c
Expand Up @@ -492,6 +492,8 @@ BOOL security_encrypt(BYTE* data, int length, rdpRdp* rdp)

BOOL security_decrypt(BYTE* data, int length, rdpRdp* rdp)
{
if (rdp->rc4_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);
Expand Down

0 comments on commit 7d58aac

Please sign in to comment.