findutils-patches
[Top][All Lists]
Advanced

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

Re: Null pointer dereference


From: Bernhard Voelker
Subject: Re: Null pointer dereference
Date: Sat, 17 Feb 2024 16:51:09 +0100
User-agent: Mozilla Thunderbird

On 2/9/24 19:13, John Seth Thielemann wrote:
> Building with a gcc nolibc / musl / linux setup found a null pointer 
dereference in the pred_and handling.
>
> Take care,
> J. Seth Thielemann

Thanks for the patch, but ...

> diff -Naur /musl/opt/findutils-4.9.0/build/findutils-4.9.0.pristine/find/pred.c 
/musl/opt/findutils-4.9.0/build>
/findutils-4.9.0/find/pred.c
> --- /musl/opt/findutils-4.9.0/build/findutils-4.9.0.pristine/find/pred.c   
2022-01-02 23:34:22.000000000 +0000
> +++ /musl/opt/findutils-4.9.0/build/findutils-4.9.0/find/pred.c    2024-02-09 
01:32:12.395992857 +0000
> @@ -150,7 +150,14 @@
>  bool
>  pred_and (const char *pathname, struct stat *stat_buf, struct predicate 
*pred_ptr)
>  {
> -  if (pred_ptr->pred_left == NULL
> +  if (pred_ptr->pred_left == NULL) {
> +          if (pred_ptr->pred_right)
> +                  return apply_predicate(pathname, stat_buf, 
pred_ptr->pred_right);
> +          else
> +                  return false;
> +  }
> +
> +  if (pred_ptr->pred_left->pred_func
>        || apply_predicate (pathname, stat_buf, pred_ptr->pred_left))
>      {
>        return apply_predicate (pathname, stat_buf, pred_ptr->pred_right);

... this breaks most of the tests.

Have a nice day,
Berny



reply via email to

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