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/simple.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples/simple.c') diff --git a/examples/simple.c b/examples/simple.c index f6e94dc..6167d72 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -3,6 +3,8 @@ int main(int argc,char** argv) { rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,400,300,8,3,4); + if(!server) + return 0; server->frameBuffer=(char*)malloc(400*300*4); rfbInitServer(server); rfbRunEventLoop(server,-1,FALSE); -- cgit v1.2.1