linux/drivers/staging/iio
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
..
accel staging:iio:lis3l02dq allow buffer implementation selection 2011-02-18 13:22:51 -08:00
adc IIO: ADC: New driver for the AD7298 8-channel SPI ADC 2011-02-28 13:39:54 -08:00
addac staging: iio: new ADT7316/7/8 and ADT7516/7/9 driver 2010-11-09 15:46:34 -08:00
dac staging: IIO: DAC: Add support for the AD5543/AD5553 2011-02-23 14:40:04 -08:00
dds Staging: IIO: DDS: AD9832 / AD9835 driver 2011-02-09 14:58:57 -08:00
Documentation IIO: Documentation: iio_utils: Prevent buffer overflow 2011-02-28 14:40:23 -08:00
gyro staging:iio:gyro:adis16130 stub removal and cleanup 2011-02-18 13:24:19 -08:00
imu staging: iio: adis16350: add missing reference to temp offset 2010-11-09 15:46:31 -08:00
light staging: iio: light remove empty light.h file 2010-10-08 07:17:56 -07:00
magnetometer Revert "staging: iio: ak8975: add platform data." 2011-02-23 14:12:25 -08:00
meter staging:iio:meter remove stubs from ade7854. 2011-02-18 13:23:50 -08:00
resolver Staging: iio: fix up world writable sysfs files. 2010-12-10 10:56:18 -08:00
trigger staging: IIO: trigger: New Blackfin specific trigger driver iio-trig-bfin-timer 2011-02-23 14:40:04 -08:00
chrdev.h staging: iio: Remove long dead function definitions from headers 2010-09-04 21:19:00 -07:00
iio.h staging: iio: convert idr to ida as pointer never provided 2010-09-04 21:18:59 -07:00
industrialio-core.c Merge 'staging-next' to Linus's tree 2010-10-28 09:44:56 -07:00
industrialio-ring.c staging:iio:buffering move the copy to user on rip down into implementations 2011-02-18 13:22:50 -08:00
industrialio-trigger.c staging: iio: remove timestamp field from trigger and pass instead through pollfuncs 2010-07-22 11:38:28 -07:00
Kconfig staging:iio:kfifo buffer implementation 2011-02-18 13:22:51 -08:00
kfifo_buf.c staging:iio:kfifo buffer implementation 2011-02-18 13:22:51 -08:00
kfifo_buf.h staging:iio:kfifo buffer implementation 2011-02-18 13:22:51 -08:00
Makefile staging:iio:kfifo buffer implementation 2011-02-18 13:22:51 -08:00
ring_generic.h staging:iio:buffering move the copy to user on rip down into implementations 2011-02-18 13:22:50 -08:00
ring_hw.h Staging: IIO: VTI sca3000 series accelerometer driver (spi) 2009-09-15 12:02:24 -07:00
ring_sw.c staging:iio:buffering move the copy to user on rip down into implementations 2011-02-18 13:22:50 -08:00
ring_sw.h staging:iio:buffering move the copy to user on rip down into implementations 2011-02-18 13:22:50 -08:00
sysfs.h Staging: iio: fix up world writable sysfs files. 2010-12-10 10:56:18 -08:00
TODO staging: iio: add ADI info to TODO 2010-11-09 15:46:32 -08:00
trigger_consumer.h Staging: iio: Staticise non-exported functions 2010-03-03 16:43:02 -08:00
trigger.h staging: iio: lis3l02dqbuffersimple.c bring example up to date. 2010-09-04 21:19:02 -07:00