From bf2470cec69ab00f7213aa136f5a2d486c9da17a Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Thu, 17 Mar 2011 13:11:59 +0100 Subject: Check rfbGetScreen() return value everywhere. This fixes a segfault when a server is invoked with the '-help' commandline argument. --- examples/vncev.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/vncev.c') diff --git a/examples/vncev.c b/examples/vncev.c index 9ebafc9..ba9441a 100644 --- a/examples/vncev.c +++ b/examples/vncev.c @@ -112,6 +112,8 @@ static enum rfbNewClientAction newclient(rfbClientPtr cl) int main(int argc,char** argv) { rfbScreenInfoPtr s=rfbGetScreen(&argc,argv,width,height,8,1,1); + if(!s) + return 0; s->colourMap.is16=FALSE; s->colourMap.count=2; s->colourMap.data.bytes=(unsigned char*)"\xd0\xd0\xd0\x30\x01\xe0"; -- cgit v1.2.3