LibVNCClient: make sure Ultra decoding cannot dereference a null pointer

Closes #254
pull/3/head
Christian Beier 6 years ago
parent 6566ba5f02
commit 4a21bbd097
No known key found for this signature in database
GPG Key ID: 421BB3B45C6067F8

@ -66,6 +66,8 @@ HandleUltraBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if ((client->raw_buffer_size % 4)!=0)
client->raw_buffer_size += (4-(client->raw_buffer_size % 4));
client->raw_buffer = (char*) malloc( client->raw_buffer_size );
if(client->raw_buffer == NULL)
return FALSE;
}
/* allocate enough space to store the incoming compressed packet */
@ -150,6 +152,8 @@ HandleUltraZipBPP (rfbClient* client, int rx, int ry, int rw, int rh)
if ((client->raw_buffer_size % 4)!=0)
client->raw_buffer_size += (4-(client->raw_buffer_size % 4));
client->raw_buffer = (char*) malloc( client->raw_buffer_size );
if(client->raw_buffer == NULL)
return FALSE;
}

Loading…
Cancel
Save