libfstools: ubi: avoid crash in volume finding function
authorRafał Miłecki <zajec5@gmail.com>
Tue, 23 Dec 2014 20:33:49 +0000 (21:33 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 6 Jan 2015 11:08:04 +0000 (12:08 +0100)
commit0bc9aa72941d2e361e77b5ff7c4a742e1de98cc2
treee0a10c1ee32f26d24854ea70b3216f31f58975c1
parenta5076ad9c92895c54eb384b224e7af1a914f1fd9
libfstools: ubi: avoid crash in volume finding function

In case /sys/devices/virtual/ubi/ubi?/ubi?_?/name doesn't exist volname
will be NULL and calling strlen for NULL isn't a good idea.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
libfstools/ubi.c