diff options
author | Christian Beier <dontmind@freeshell.org> | 2018-10-01 19:38:33 +0200 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2018-10-01 19:38:33 +0200 |
commit | 4a21bbd097ef7c44bb000c3bd0907f96a10e4ce7 (patch) | |
tree | 7f1d765c0fd71bc2d1db865319268d2516f179b9 /libvncclient | |
parent | 6566ba5f0261ad350d8371b17b380174926495d6 (diff) | |
download | libtdevnc-4a21bbd097ef7c44bb000c3bd0907f96a10e4ce7.tar.gz libtdevnc-4a21bbd097ef7c44bb000c3bd0907f96a10e4ce7.zip |
LibVNCClient: make sure Ultra decoding cannot dereference a null pointer
Closes #254
Diffstat (limited to 'libvncclient')
-rw-r--r-- | libvncclient/ultra.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libvncclient/ultra.c b/libvncclient/ultra.c index a82e2ed..a287526 100644 --- a/libvncclient/ultra.c +++ b/libvncclient/ultra.c @@ -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; } |