mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
17 lines
513 B
Diff
17 lines
513 B
Diff
|
diff --git a/vncviewer/zlib.c b/vncviewer/zlib.c
|
||
|
index 80c4eee..76998d8 100644
|
||
|
--- a/vncviewer/zlib.c
|
||
|
+++ b/vncviewer/zlib.c
|
||
|
@@ -55,6 +55,11 @@ HandleZlibBPP (int rx, int ry, int rw, int rh)
|
||
|
raw_buffer_size = (( rw * rh ) * ( BPP / 8 ));
|
||
|
raw_buffer = (char*) malloc( raw_buffer_size );
|
||
|
|
||
|
+ if ( raw_buffer == NULL ) {
|
||
|
+ fprintf(stderr,
|
||
|
+ "couldn't allocate raw_buffer in HandleZlibBPP");
|
||
|
+ return False;
|
||
|
+ }
|
||
|
}
|
||
|
|
||
|
if (!ReadFromRFBServer((char *)&hdr, sz_rfbZlibHeader))
|