aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYan Zhu <zhuyan2015@foxmail.com>2023-09-12 00:03:09 +0800
committerDenys Vlasenko <vda.linux@googlemail.com>2024-04-13 17:57:46 +0200
commit681e4f5d922b9f0ea968238750d5c5d748eac809 (patch)
tree01c9da53bb93254143299f9ad0105d3fe893200c
parente1a68741067167dc4837e0a26d3d5c318a631fc7 (diff)
downloadbusybox-w32-681e4f5d922b9f0ea968238750d5c5d748eac809.tar.gz
busybox-w32-681e4f5d922b9f0ea968238750d5c5d748eac809.tar.bz2
busybox-w32-681e4f5d922b9f0ea968238750d5c5d748eac809.zip
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>
-rw-r--r--scripts/basic/docproc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/basic/docproc.c b/scripts/basic/docproc.c
index 4464e1874..8828901a1 100644
--- a/scripts/basic/docproc.c
+++ b/scripts/basic/docproc.c
@@ -180,6 +180,7 @@ void find_export_symbols(char * filename)
180 { 180 {
181 fprintf(stderr, "docproc: "); 181 fprintf(stderr, "docproc: ");
182 perror(real_filename); 182 perror(real_filename);
183 exit(1);
183 } 184 }
184 while (fgets(line, MAXLINESZ, fp)) { 185 while (fgets(line, MAXLINESZ, fp)) {
185 unsigned char *p; 186 unsigned char *p;