Re: [PATCH] tools:iio: Fix the potential stack overflow risk

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

 



On Thu, Mar 24, 2022 at 3:15 PM jianchunfu
<jianchunfu@xxxxxxxxxxxxxxxxxxxx> wrote:
>
> Add judgment to fix the potential stack overflow risk.

>                 trigger_name = malloc(IIO_MAX_NAME_LENGTH);
> +               if (!trigger_name) {
> +                       ret = -ENOMEM;
> +                       goto error;
> +               }

Isn't malloc() sets errno? Why not use it instead?

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux