linux/drivers/staging/iio/Documentation
Michael Hennerich 7ccd4506fa IIO: Documentation: iio_utils: Prevent buffer overflow
The first part of build_channel_array()identifies the number of enabled channels.
Further down this count is used to allocate the ci_array. The next section parses the
scan_elements directory again, and fills ci_array regardless if the channel is enabled or not.
So if less than available channels are enabled ci_array memory is overflowed.

This fix makes sure that we allocate enough memory. But the whole approach looks a bit
cumbersome to me. Why not allocate memory for MAX_CHANNLES, less say 64
(I never seen a part with more than that channels). And skip the first part entirely.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28 14:40:23 -08:00
..
dac Staging: iio: add driver for MAX517/518/519 2011-01-21 12:20:56 -08:00
device.txt
generic_buffer.c IIO: Documentation: generic_buffer example: Avoid NULL pointer dereference 2011-02-28 14:40:22 -08:00
iio_utils.h IIO: Documentation: iio_utils: Prevent buffer overflow 2011-02-28 14:40:23 -08:00
overview.txt
ring.txt
sysfs-bus-iio IIO: ADC: New driver for the AD7298 8-channel SPI ADC 2011-02-28 13:39:54 -08:00
sysfs-bus-iio-dds Staging: IIO: Direct digital synthesis abi documentation 2010-12-16 12:23:03 -08:00
sysfs-bus-iio-light
sysfs-bus-iio-trigger-sysfs Staging: IIO: TRIGGER: New sysfs based trigger 2011-02-09 14:56:42 -08:00
trigger.txt
userspace.txt