From 64c9bf043f3f0682893b10b04226a187a6e8d8b6 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 23 Dec 2009 18:04:26 +0000 Subject: [PATCH] Fix a segfault when selecting a non-existent game entry to watch. Found by blackpenguin. git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@521 db0b04b0-f4d1-0310-9a6d-de3e77497b0e --- TODO | 7 +++++++ dgamelaunch.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 51238a2..f298116 100644 --- a/TODO +++ b/TODO @@ -1,3 +1,10 @@ +-when exiting from watching a player, move the cursor to the last line + of the screen before enabling the ncurses mode; so when we exit dgl, + the watched player's game is all visible and the menu prompt doesn't + mess it up. +-watching menu will hilight the first matching username... what if we have + more than one game installed, and someone's playing more than one at the + same time? Should also save game#, not just the username. -allow admin to disabling the 'm' mail key in ttyplay. -update README -maybe allow something like changed_menu="[Updated %d]" config option and diff --git a/dgamelaunch.c b/dgamelaunch.c index 31b4b70..7ec2e44 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -583,7 +583,7 @@ inprogressmenu (int gameid) if (strchr(selectorchars, menuchoice) && (len > 0)) { int sidx = strchr(selectorchars, menuchoice) - selectorchars; - if (sidx > max_height) { + if ((sidx > max_height) || (sidx >= len)) { selected = -1; break; } -- 2.47.3