linux-stable/tools/iio
Chenyuan Mi 49d736313d tools: iio: iio_generic_buffer: Fix some integer type and calculation
In function size_from_channelarray(), the return value 'bytes' is defined
as int type. However, the calcution of 'bytes' in this function is designed
to use the unsigned int type. So it is necessary to change 'bytes' type to
unsigned int to avoid integer overflow.

The size_from_channelarray() is called in main() function, its return value
is directly multipled by 'buf_len' and then used as the malloc() parameter.
The 'buf_len' is completely controllable by user, thus a multiplication
overflow may occur here. This could allocate an unexpected small area.

Signed-off-by: Chenyuan Mi <michenyuan@huawei.com>
Link: https://lore.kernel.org/r/20230725092407.62545-1-michenyuan@huawei.com
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2023-07-29 15:59:20 +01:00
..
.gitignore
Build
iio_event_monitor.c iio: event_monitor: add pitch, yaw and roll modifiers 2022-09-21 18:42:55 +01:00
iio_generic_buffer.c tools: iio: iio_generic_buffer: Fix some integer type and calculation 2023-07-29 15:59:20 +01:00
iio_utils.c tools/iio/iio_utils:fix memory leak 2023-01-21 17:52:26 +00:00
iio_utils.h
lsiio.c
Makefile kbuild: replace $(if A,A,B) with $(or A,B) 2022-02-15 12:25:56 +09:00