acl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Handle memory issues with large files


From: Mike Frysinger
Subject: Re: [PATCH] Handle memory issues with large files
Date: Sat, 12 Nov 2022 21:10:07 +0700

On 09 Jan 2022 12:00, Samanta Navarro wrote:
> --- a/tools/parse.c
> +++ b/tools/parse.c
> @@ -447,8 +447,11 @@ read_acl_comments(
>                       (*lineno)++;
>  
>               line = __acl_next_line(file);
> -             if (line == NULL)
> -                     break;
> +             if (line == NULL) {
> +                     if (feof(file))
> +                             break;
> +                     goto fail;
> +             }

this looks OK

> @@ -580,6 +583,8 @@ read_acl_seq(
>  
>       if (ferror(file))
>               goto fail;
> +     if (!feof(file) && line == NULL)
> +             return -1;

this seems like it should "goto fail" instead of returning -1 directly
-mike

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]