-
-
Save invisiblek/fce1c3dfbb9ab5b79595 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/util-linux/volume_id/get_devname.c b/util-linux/volume_id/get_devname.c | |
index e9d13aa..82c4e99 100644 | |
--- a/util-linux/volume_id/get_devname.c | |
+++ b/util-linux/volume_id/get_devname.c | |
@@ -270,6 +270,10 @@ char *get_fstype_from_devname(const char *device) | |
{ | |
#if ENABLE_FEATURE_BLKID_TYPE | |
struct uuidCache_s *uc; | |
+ struct stat *statbuf; | |
+ | |
+ if (stat(device, statbuf) < 0 || !S_ISBLK(statbuf->st_mode)) | |
+ return NULL; | |
add_to_uuid_cache(device); | |
uc = uuidcache_init(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment