Fix chkfont coredump on invalid input

Based on patch submitted by Kenneth Davies <kshrub@yahoo.com>
submitted in Debian bug . Decrufted to provide double free()
fix, with minimal changes to FIGlet coding styles.

Bug-Debian: http://bugs.debian.org/300735

Signed-off-by: Jonathan McCrohan <jmccrohan@gmail.com>
Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>
This commit is contained in:
Jonathan McCrohan 2012-05-29 22:54:39 +01:00 committed by Claudio Matsuoka
parent e0e63ca90a
commit 24b935eb59

@ -272,6 +272,7 @@ numsread=sscanf(fileline,"%c %d %d %d %d %d %d %d %d",
&hardblank,&charheight,&upheight,&maxlen,&old_layout,&cmtcount,
&ffrighttoleft,&layout,&spectagcnt);
free(fileline);
fileline = NULL;
if (numsread<7) {
ffrighttoleft=0;
}