]> git.ipfire.org Git - thirdparty/grub.git/commit
disk/lvm: Do not crash if an expected string is not found
authorDaniel Axtens <dja@axtens.net>
Thu, 21 Jan 2021 07:35:22 +0000 (18:35 +1100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:18 +0000 (15:54 +0100)
commitdb29073fc7aec71a40dabfc722a96ea9f3280907
tree532ecc87202a0b10c7c4a05b15701169879e8c9b
parent2958695c4cdc785de6ed708709af071a2d20afef
disk/lvm: Do not crash if an expected string is not found

Clean up a bunch of cases where we could have strstr() fail and lead to
us dereferencing NULL.

We'll still leak memory in some cases (loops don't clean up allocations
from earlier iterations if a later iteration fails) but at least we're
not crashing.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/disk/lvm.c