block: Fix potential Null pointer dereferences in vvfat.c
commit8d9401c2791ee2d2805b741b1ee3006041edcd3e
authorLiam Merwick <Liam.Merwick@oracle.com>
Mon, 5 Nov 2018 21:38:38 +0000 (5 21:38 +0000)
committerMax Reitz <mreitz@redhat.com>
Mon, 12 Nov 2018 16:49:21 +0000 (12 17:49 +0100)
treecf679432002d6c52ba8a4ffe4a0dea704ee0b349
parent2e2db260093d44130a8a2974aed3cc8149c0a08d
block: Fix potential Null pointer dereferences in vvfat.c

The calls to find_mapping_for_cluster() may return NULL but it
isn't always checked for before dereferencing the value returned.
Additionally, add some asserts to cover cases where NULL can't
be returned but which might not be obvious at first glance.

Signed-off-by: Liam Merwick <Liam.Merwick@oracle.com>
Message-id: 1541453919-25973-5-git-send-email-Liam.Merwick@oracle.com
[mreitz: Dropped superfluous check of "mapping" following an assertion
         that it is not NULL, and fixed some indentation]
Signed-off-by: Max Reitz <mreitz@redhat.com>
block/vvfat.c