libblock: Avoid NULL pointer access

This commit is contained in:
Sebastian Huber
2015-10-30 13:00:01 +01:00
parent 65243416f9
commit 09d4f629b2

View File

@@ -203,7 +203,9 @@ static media_item *get_media_item(
if ( if (
(disk_path == NULL || strcmp(disk_path, item->disk_path) == 0) (disk_path == NULL || strcmp(disk_path, item->disk_path) == 0)
&& (mount_path == NULL || strcmp(mount_path, item->mount_path) == 0) && (mount_path == NULL
|| (item->mount_path != NULL
&& strcmp(mount_path, item->mount_path) == 0))
) { ) {
return item; return item;
} }