From: H.G.Muller Date: Mon, 2 Jun 2014 17:34:47 +0000 (+0200) Subject: Fix crash on reading some FENs X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=28f101a78d114364e46e053a84a185895f104750;p=hachu.git Fix crash on reading some FENs It was possible to read beyond the end of a FEN when converting it to internal format, which could lead to all kind of nastiness. --- diff --git a/hachu.c b/hachu.c index 711ec43..0eea758 100644 --- a/hachu.c +++ b/hachu.c @@ -2318,6 +2318,7 @@ Convert (char *fen) *p++ = table[2* (*fen - 'A' - n)+1] + n; } } else *p++ = *fen; + if(!*fen) break; fen++; } printf("# converted FEN '%s'\n", fenArray);