summaryrefslogtreecommitdiffstats
path: root/VisualNaCro
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2011-03-17 13:11:59 +0100
committerChristian Beier <dontmind@freeshell.org>2011-03-17 13:11:59 +0100
commitbf2470cec69ab00f7213aa136f5a2d486c9da17a (patch)
tree9ff1c77459eabd1ef1fc594c190cbb455c92a0bd /VisualNaCro
parent6b60690a4a1642c77bd6ac42789c4da6ed770075 (diff)
downloadlibvncserver-bf2470cec69ab00f7213aa136f5a2d486c9da17a.zip
libvncserver-bf2470cec69ab00f7213aa136f5a2d486c9da17a.tar.gz
Check rfbGetScreen() return value everywhere.
This fixes a segfault when a server is invoked with the '-help' commandline argument.
Diffstat (limited to 'VisualNaCro')
-rw-r--r--VisualNaCro/nacro.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/VisualNaCro/nacro.c b/VisualNaCro/nacro.c
index 2fc9e36..9c492b0 100644
--- a/VisualNaCro/nacro.c
+++ b/VisualNaCro/nacro.c
@@ -121,6 +121,8 @@ static rfbBool malloc_frame_buffer(rfbClient* cl)
res->client->frameBuffer=malloc(w*4*h);
res->server=rfbGetScreen(NULL,NULL,w,h,8,3,4);
+ if(!res->server)
+ return FALSE;
res->server->screenData=res;
res->server->port=res->listen_port;
res->server->frameBuffer=res->client->frameBuffer;
OpenPOWER on IntegriCloud