acl-devel
[Top][All Lists]
Advanced

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

Re: [PATCH acl] Fix usage of uninitialized variable


From: Mike Frysinger
Subject: Re: [PATCH acl] Fix usage of uninitialized variable
Date: Sat, 10 Dec 2022 17:59:40 +0900

On 03 Dec 2022 12:12, Guillem Jover wrote:
> From: Vasily Gurevich <vas.gurevich@gmail.com>
> 
> Ref: https://bugs.debian.org/612599
> Signed-off-by: Guillem Jover <guillem@hadrons.org>

this, nor the referenced bug, explains what uninitialized variables are used

> --- a/tools/getfacl.c
> +++ b/tools/getfacl.c
> @@ -381,6 +381,8 @@ int do_show(FILE *stream, const char *path_p, const 
> struct stat *st,
>                       show_line(stream, NULL, NULL, NULL, NULL,
>                                 &dacl_names, dacl, &dacl_ent, dacl_mask);
>                       continue;
> +             } else if (!dacl && !acl) {
> +                     return -1;

this looks wrong.  the function has state that needs to be freed, so returning
leaks memory.  also, show_line isn't called which seems like it's supposed to.
-mike

Attachment: signature.asc
Description: PGP signature


reply via email to

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