]> www.infradead.org Git - users/hch/nvme-cli.git/commit
Fix null pointer dereference on strlen()
authorColin Ian King <colin.king@canonical.com>
Thu, 2 Jun 2016 18:25:54 +0000 (19:25 +0100)
committerColin Ian King <colin.king@canonical.com>
Thu, 2 Jun 2016 18:25:54 +0000 (19:25 +0100)
commit248f41fc82e85e3722084c54d900b4fc36a34081
tree8510c5e534d8a29855aa8e11175d499e1136066d
parent91c61f187fc953e149a648b9c7108945848132af
Fix null pointer dereference on strlen()

If string is NULL, then the proceeding strlen() on the string
will lead to a NULL pointer dereference error (segmentation fault).
Fix this by swapping the order of the comparisons, first check for
a NULL pointer; if that's not true then do the strlen check.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
src/argconfig.c