docproc: avoid segfault during file closing

In the function find_export_symbols, since the fopen file does not
exit when it fails, there is a dereference problem in fclose(fp),
which will cause a segmentation fault.

Signed-off-by: Yan Zhu <zhuyan2015@foxmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
master
Yan Zhu 2023-09-12 00:03:09 +08:00 committed by Denys Vlasenko
parent e1a6874106
commit 681e4f5d92
1 changed files with 1 additions and 0 deletions

View File

@ -180,6 +180,7 @@ void find_export_symbols(char * filename)
{
fprintf(stderr, "docproc: ");
perror(real_filename);
exit(1);
}
while (fgets(line, MAXLINESZ, fp)) {
unsigned char *p;