From 28f101a78d114364e46e053a84a185895f104750 Mon Sep 17 00:00:00 2001 From: H.G.Muller Date: Mon, 2 Jun 2014 19:34:47 +0200 Subject: [PATCH] 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. --- hachu.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) 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); -- 1.7.0.4