ITS#6755 pagedresults loop was accessing a closed FILE*.

This commit is contained in:
Howard Chu 2011-02-01 05:24:53 +00:00
parent 293b5e51a5
commit a7e0c6cd2e

View File

@ -918,6 +918,15 @@ main( int argc, char **argv )
tool_bind( ld );
getNextPage:
/* fp may have been closed, need to reopen if code jumps
* back here to getNextPage.
*/
if ( !fp && infile ) {
if (( fp = fopen( infile, "r" )) == NULL ) {
perror( infile );
return EXIT_FAILURE;
}
}
save_nctrls = nctrls;
i = nctrls;
if ( nctrls > 0
@ -1259,6 +1268,7 @@ getNextPage:
}
if ( fp != stdin ) {
fclose( fp );
fp = NULL;
}
}