* Add a sanity check to the FIGlet font loader.

This commit is contained in:
Sam Hocevar 2006-11-06 00:45:34 +00:00 committed by sam
parent 3f44cc843f
commit 8cca295e10

View file

@ -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;
}