helpers: fix a crash in gpiod_chip_find_line()
authorBartosz Golaszewski <bartekgola@gmail.com>
Fri, 20 Oct 2017 09:00:45 +0000 (11:00 +0200)
committerBartosz Golaszewski <bartekgola@gmail.com>
Fri, 20 Oct 2017 09:12:50 +0000 (11:12 +0200)
commit0a2586e956d4348386899ee6af949abf27cfe66b
tree6342df87070ccbe58302187fbfecdfd96ac5dc82
parent5a8d681dca1d4bc3b5ebd5c4188b3e3e6f23acfd
helpers: fix a crash in gpiod_chip_find_line()

The name of a line can be NULL in which case we must check it and skip
the call to strcmp() to avoid a NULL pointer dereference.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
src/lib/helpers.c
tests/tests-line.c