diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-10-30 13:00:01 +0100 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-11-02 08:23:17 +0100 |
commit | 12b5264318591a861e669e14ccb7f1bc5bb6249a (patch) | |
tree | 3f1d11aad116db79fd0c830776aa8fd7a4b9b437 | |
parent | ada: Add missing include (diff) | |
download | rtems-12b5264318591a861e669e14ccb7f1bc5bb6249a.tar.bz2 |
libblock: Avoid NULL pointer access
-rw-r--r-- | cpukit/libblock/src/media.c | 4 |
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; } |