From 8cca295e10d4b37e93b8d92c0ff8cd87a44a1fdc Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 6 Nov 2006 00:45:34 +0000 Subject: [PATCH] * Add a sanity check to the FIGlet font loader. --- src/figlet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/figlet.c b/src/figlet.c index 6c8356a..80302d9 100644 --- a/src/figlet.c +++ b/src/figlet.c @@ -198,11 +198,11 @@ static int open_font(context_t *cx) if(toigets(buf, 2048, f) == NULL) break; - if(!buf[0]) + if(!buf[0] || buf[0] < '0' || buf[0] > '9') { free(data); free(cx->lookup); - fprintf(stderr, "read error at glyph %u in `%s'\n", + fprintf(stderr, "read error at glyph #%u in `%s'\n", cx->glyphs, path); return -1; }