[gnome-games/gnome-2-32] chess: Fix crash decoding empty SAN string



commit ea9f83a668d3313e998943c53d9ba1d473637d09
Author: Robert Ancell <robert ancell canonical com>
Date:   Mon May 2 16:06:18 2011 +1000

    chess: Fix crash decoding empty SAN string

 glchess/src/lib/chess/san.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/glchess/src/lib/chess/san.py b/glchess/src/lib/chess/san.py
index 182e44b..ebc7d93 100644
--- a/glchess/src/lib/chess/san.py
+++ b/glchess/src/lib/chess/san.py
@@ -107,6 +107,9 @@ class SANConverter:
         """
         copy = san[:]
         
+        if copy == '':
+            raise Error("Empty string")
+
         # Look for check hints
         expectedResult = True
         if copy[-1] == self.CHECK or copy[-1] == self.CHECKMATE:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]