]> git.baikalelectronics.ru Git - kernel.git/commit
tools: gpio-hammer: Avoid potential overflow in main
authorGabriel Ravier <gabravier@gmail.com>
Thu, 12 Mar 2020 14:50:21 +0000 (15:50 +0100)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 25 Mar 2020 08:50:45 +0000 (09:50 +0100)
commit3c765dc13697e53454a32fc995b9ea0e1cce9a96
tree3e2b25ad26ca3a3c3a708a108c74e98c6d624518
parentfc29be756840cbd14ac2f2a84e9ddfd360553927
tools: gpio-hammer: Avoid potential overflow in main

If '-o' was used more than 64 times in a single invocation of gpio-hammer,
this could lead to an overflow of the 'lines' array. This commit fixes
this by avoiding the overflow and giving a proper diagnostic back to the
user

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
tools/gpio/gpio-hammer.c