mirror of
https://github.com/mirror/busybox.git
synced 2025-09-10 22:45:25 +02:00
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>
This commit is contained in:
@@ -180,6 +180,7 @@ void find_export_symbols(char * filename)
|
|||||||
{
|
{
|
||||||
fprintf(stderr, "docproc: ");
|
fprintf(stderr, "docproc: ");
|
||||||
perror(real_filename);
|
perror(real_filename);
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
while (fgets(line, MAXLINESZ, fp)) {
|
while (fgets(line, MAXLINESZ, fp)) {
|
||||||
unsigned char *p;
|
unsigned char *p;
|
||||||
|
|||||||
Reference in New Issue
Block a user