Skip to content
Commit 66c65d90 authored by Craig Markwardt's avatar Craig Markwardt Committed by Jonathan Cameron
Browse files

iio: Fix a buffer overflow in iio_utils.h example code



This was originally reported by Craig Markwardt on Zubair Lutfullah's
blog and Zubair forwarded it to linux-iio@vger.kernel.org. No email
address known.

The code first counted the number of enabled channels, then created an
array to hold information about them.  The code that filled this array then
stored whether a given element was enabled inside the array.  Curriously
this element was never used.  Craig's patch added a local temporary variable
to avoid the buffer overrun.  Jonathan then removed the original enabled
element of the structure as it was not needed at all.

Signed-off-by: default avatarZubair Lutfullah <zubair.lutfullah@gmail.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent e9ed104d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment