[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] docproc: avoid segfault during file closing
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2024-04-13 15:57:53
Message-ID: CAK1hOcPiDUJhqy9fH1KQ10zTYz12sh_5M9tRnaY6Zm4-Xh74Aw () mail ! gmail ! com
[Download RAW message or body]

Applied, thank you.

On Mon, Sep 11, 2023 at 6:03 PM Yan Zhu <zhuyan2015@foxmail.com> wrote:
>
> 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>
> ---
>  scripts/basic/docproc.c | 1 +
>  1 file changed, 1 insertion(+)
>
> 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)
>                 {
>                         fprintf(stderr, "docproc: ");
>                         perror(real_filename);
> +                       exit(1);
>                 }
>                 while (fgets(line, MAXLINESZ, fp)) {
>                         unsigned char *p;
> --
> 2.33.0
>
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic