Re: [PATCH] iio-utils: fix memory overflow for dynamically allocateded memory to hold filename

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

 



Sorry, pls ignore this one. I made a mis-operation It is actual:
-						+ 1);
+						+ 1
+						+ IIO_MAX_NAME_LENGTH);

i will re-send it.

On Mon, May 24, 2010 at 5:30 PM, Barry Song <21cnbao@xxxxxxxxx> wrote:
> Signed-off-by: Barry Song <21cnbao@xxxxxxxxx>
> ---
>  drivers/staging/iio/Documentation/iio_utils.h |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/iio/Documentation/iio_utils.h b/drivers/staging/iio/Documentation/iio_utils.h
> index 6411bf9..a4555e6 100644
> --- a/drivers/staging/iio/Documentation/iio_utils.h
> +++ b/drivers/staging/iio/Documentation/iio_utils.h
> @@ -64,8 +64,7 @@ inline int find_type_by_name(const char *name, const char *type)
>                                                + strlen(type)
>                                                + 1
>                                                + numstrlen
> -                                               + 1
> -                                               + IIO_MAX_NAME_LENGTH);
> +                                               + 1);
>                                if (filename == NULL)
>                                        return -ENOMEM;
>                                sprintf(filename, "%s%s%d/name",
> --
> 1.5.6.3
>
>
��.n��������+%������w��{.n�����{��(��)��jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[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