summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2010-01-04 19:38:29 +0100
committerJohannes Schindelin <johannes.schindelin@gmx.de>2010-01-04 23:31:29 +0100
commit5cbe612618c13db021e2b1bdbb9559fdad755e39 (patch)
tree1f73daf6877b45c8fbd7032f456906469c28bc00
parentb6d5983560f1229ec39392d7d5489737cc1c4b64 (diff)
downloadlibvncserver-5cbe612618c13db021e2b1bdbb9559fdad755e39.zip
libvncserver-5cbe612618c13db021e2b1bdbb9559fdad755e39.tar.gz
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 <dontmind@freeshell.org> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
-rw-r--r--vncterm/LinuxVNC.c4
-rw-r--r--vncterm/VNConsole.c4
2 files changed, 5 insertions, 3 deletions
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=
OpenPOWER on IntegriCloud