From 8aee048310cb23a94bbee0ddd058c00e84982a55 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Tue, 27 Mar 2018 17:43:37 -0500 Subject: [PATCH] libfrog: handle NULL dir && blkdev in __fs_table_lookup_mount If neither dir nor blkdev is set, dpath never gets set, and then gets used (uninitalized) later on. If we are asked where "nothing" is mounted, just return "nowhere." Fixes-coverity-id: 1433615 Fixes-coverity-id: 1433616 Signed-off-by: Eric Sandeen Reviewed-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- libfrog/paths.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libfrog/paths.c b/libfrog/paths.c index 318b48f99..c7895e9b2 100644 --- a/libfrog/paths.c +++ b/libfrog/paths.c @@ -98,6 +98,9 @@ __fs_table_lookup_mount( char rpath[PATH_MAX]; char dpath[PATH_MAX]; + if (!dir && !blkdev) + return NULL; + if (dir && !realpath(dir, dpath)) return NULL; if (blkdev && !realpath(blkdev, dpath)) -- 2.47.2