summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-10-30 13:00:01 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-11-02 08:23:17 +0100
commit12b5264318591a861e669e14ccb7f1bc5bb6249a (patch)
tree3f1d11aad116db79fd0c830776aa8fd7a4b9b437 /cpukit
parentada: Add missing include (diff)
downloadrtems-12b5264318591a861e669e14ccb7f1bc5bb6249a.tar.bz2
libblock: Avoid NULL pointer access
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/libblock/src/media.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/libblock/src/media.c b/cpukit/libblock/src/media.c
index 8953b79e8b..ec29eea501 100644
--- a/cpukit/libblock/src/media.c
+++ b/cpukit/libblock/src/media.c
@@ -203,7 +203,9 @@ static media_item *get_media_item(
if (
(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;
}