From 5cbe612618c13db021e2b1bdbb9559fdad755e39 Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Mon, 4 Jan 2010 19:38:29 +0100 Subject: LinuxVNC: fix segfault at "linuxvnc 1 -help". This fixes Debian Bug #399501: Switch to tty1. Run "linuxvnc 1 -help". You see help text, followed by "Segmentation fault". Signed-off-by: Christian Beier Signed-off-by: Johannes Schindelin --- vncterm/LinuxVNC.c | 4 +++- vncterm/VNConsole.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'vncterm') diff --git a/vncterm/LinuxVNC.c b/vncterm/LinuxVNC.c index 2534341..5a3c3a3 100644 --- a/vncterm/LinuxVNC.c +++ b/vncterm/LinuxVNC.c @@ -113,7 +113,9 @@ int main(int argc,char **argv) sprintf(title,"LinuxVNC: /dev/tty%d",tty); /* console init */ - console=vcGetConsole(&argc,argv,width,height,&vgaFont,TRUE); + if(!(console=vcGetConsole(&argc,argv,width,height,&vgaFont,TRUE))) + exit(1); + for(i=0;i<16;i++) { console->screen->colourMap.data.bytes[i*3+0]=default_red[color_table[i]]; console->screen->colourMap.data.bytes[i*3+1]=default_grn[color_table[i]]; diff --git a/vncterm/VNConsole.c b/vncterm/VNConsole.c index d0757ba..e87df54 100644 --- a/vncterm/VNConsole.c +++ b/vncterm/VNConsole.c @@ -121,8 +121,8 @@ vncConsolePtr vcGetConsole(int *argc,char **argv, if(c->cy1<0) c->cy2=0; - c->screen= - rfbGetScreen(argc,argv,c->cWidth*c->width,c->cHeight*c->height,8,1,1); + if(!(c->screen = rfbGetScreen(argc,argv,c->cWidth*c->width,c->cHeight*c->height,8,1,1))) + return NULL; c->screen->screenData=(void*)c; c->screen->displayHook=vcMakeSureCursorIsDrawn; c->screen->frameBuffer= -- cgit v1.2.1