diff options
author | Christian Beier <dontmind@freeshell.org> | 2011-03-17 13:11:59 +0100 |
---|---|---|
committer | Christian Beier <dontmind@freeshell.org> | 2011-03-17 13:11:59 +0100 |
commit | bf2470cec69ab00f7213aa136f5a2d486c9da17a (patch) | |
tree | 9ff1c77459eabd1ef1fc594c190cbb455c92a0bd /examples/fontsel.c | |
parent | 6b60690a4a1642c77bd6ac42789c4da6ed770075 (diff) | |
download | libtdevnc-bf2470ce.tar.gz libtdevnc-bf2470ce.zip |
Check rfbGetScreen() return value everywhere.
This fixes a segfault when a server is invoked with the
'-help' commandline argument.
Diffstat (limited to 'examples/fontsel.c')
-rw-r--r-- | examples/fontsel.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/fontsel.c b/examples/fontsel.c index 85d2624..15139dc 100644 --- a/examples/fontsel.c +++ b/examples/fontsel.c @@ -41,6 +41,9 @@ int main(int argc,char** argv) rfbScreenInfoPtr s=rfbGetScreen(&argc,argv,640,480,8,3,3); int i,j; + if(!s) + return 0; + s->frameBuffer=(char*)malloc(640*480*3); rfbInitServer(s); |