diff -u gnome-games-2.26.0/debian/changelog gnome-games-2.26.0/debian/changelog --- gnome-games-2.26.0/debian/changelog +++ gnome-games-2.26.0/debian/changelog @@ -1,3 +1,10 @@ +gnome-games (1:2.26.0-0ubuntu4) jaunty; urgency=low + + * debian/patches/03_sudoku_crash_saved_files.patch: + - Fix gnome-sudoku crash when reading corrupted saved games. + + -- Saïvann Carignan Mon, 30 Mar 2009 02:29:18 -0400 + gnome-games (1:2.26.0-0ubuntu3) jaunty; urgency=low * debian/control: diff -u gnome-games-2.26.0/debian/patches/series gnome-games-2.26.0/debian/patches/series --- gnome-games-2.26.0/debian/patches/series +++ gnome-games-2.26.0/debian/patches/series @@ -1,5 +1,6 @@ 01_lpi.patch 02_desktop-path.patch +03_sudoku_crash_saved_files.patch 80_change_tetris_theme.patch 81_deprecate_gnome_print.patch 99_autotools.patch only in patch2: unchanged: --- gnome-games-2.26.0.orig/debian/patches/03_sudoku_crash_saved_files.patch +++ gnome-games-2.26.0/debian/patches/03_sudoku_crash_saved_files.patch @@ -0,0 +1,30 @@ +Index: gnome-games-2.26.0/gnome-sudoku/src/lib/saver.py +=================================================================== +--- gnome-games-2.26.0/gnome-sudoku/src/lib/saver.py 2009/03/28 00:47:14 8910 ++++ gnome-games-2.26.0/gnome-sudoku/src/lib/saver.py 2009/03/28 02:05:39 8911 +@@ -211,8 +211,22 @@ + except: + print 'Warning: could not read file',f + else: +- jar['saved_at']=os.stat(f)[8] +- games.append(jar) ++ if self.is_valid(jar): ++ jar['saved_at']=os.stat(f)[8] ++ games.append(jar) ++ else: ++ print 'Warning: malformed save game',f + return games +- ++ ++ def is_valid (self, jar): ++ virgin = jar['game'].split('\n')[0].replace(' ','') ++ played = jar['game'].split('\n')[1].replace(' ','') ++ ++ if len(virgin) != 81 or len(played) != 81: ++ return False ++ ++ if not virgin.isdigit() or not played.isdigit(): ++ return False ++ ++ return True +