Package: tuxtype
Version: 1.5.16.dfsg1-1
Severity: important
Tags: patch

tuxtype segfaults if you like to play a game in a german utf8 env with
contains one of these symbols: ÄÖÜß.
I'll attach two fixes here: 
The first one will fix that valid words are not used because the symbols
are not known in keyboard.lst. 
The second will fix that if there are no words the game crashs. ATM
you'll get a tux waiting for nothing.. but this is much better than a
crashed game. For the future and as a todo it should be possible to add
there a warning dialog (and abort this particular game & go back into
main menu)

Greetings
Winnie

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.24 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages tuxtype depends on:
ii  libc6                     2.7-9          GNU C Library: Shared libraries
ii  libsdl-image1.2           1.2.6-3        image loading library for Simple D
ii  libsdl-mixer1.2           1.2.8-3        mixer library for Simple DirectMed
ii  libsdl-pango1             0.1.2-4        text rendering with Pango in SDL a
ii  libsdl-ttf2.0-0           2.0.9-1        ttf library for Simple DirectMedia
ii  libsdl1.2debian           1.2.13-2       Simple DirectMedia Layer
ii  ttf-malayalam-fonts       1:0.5.1        Free TrueType fonts for the Malaya
ii  ttf-sil-andika            0.001.desrev-5 smart Unicode sans serif font for 
ii  ttf-sil-doulos            4.102-1        smart Unicode font for Latin and C
ii  tuxtype-data              1.5.16.dfsg1-1 Data files for the Educational Typ

tuxtype recommends no packages.

-- no debconf information
Index: keyboard.lst
===================================================================
--- keyboard.lst        (Revision 456)
+++ keyboard.lst        (Arbeitskopie)
@@ -54,7 +54,7 @@
 5| 
 0|!
 0|@
-0|#
+9|#
 0|1
 0|2
 0|3
@@ -67,4 +67,14 @@
 0|0
 7|,
 8|.
-9|;
+7|;
+8|:
+9|-
+9|_
+9|ö
+9|Ö
+9|ü
+9|Ü
+9|ö
+9|Ö
+9|ß
Index: laser.c
===================================================================
--- laser.c	(Revision 456)
+++ laser.c	(Arbeitskopie)
@@ -830,6 +830,11 @@
           int i = 0;
           comet_type* prev_comet = NULL;
 
+          /* Do nothing if word is a NULL pointer. This could happen for example if a char  *
+             in a word is not listed keyboard.lst of this specific language. It would imho  *
+             be nicer to get here a warning or a error and not a tux waiting for nothing.   *
+             This have to be fixed later.                                                   */
+          if (word != NULL) {
           DEBUGCODE {fprintf(stderr, "word is: %S\tlength is: %d\n", word, (int)wcslen(word));}
           do
           { 
@@ -866,6 +871,7 @@
 				DEBUGCODE {fprintf(stderr, "Assigning letter to comet: %C\n", word[i]);}
 			}
 		}
+		}
 	}
 	LOG ("Leaving laser_add_comet()\n");
 }

Reply via email to