diff options
author | Brian C. Lane <bcl@redhat.com> | 2021-08-19 13:56:31 -0700 |
---|---|---|
committer | Brian C. Lane <bcl@redhat.com> | 2021-08-25 15:27:02 -0700 |
commit | 74636ce7f34081e92c5680f34588217978306488 (patch) | |
tree | 606a9e81bd99daa62c3428adb945cf53e38fd38e /libparted/arch/linux.c | |
parent | 9e194581edf31ddd2474e7be5393578542b4ef8d (diff) | |
download | parted-74636ce7f34081e92c5680f34588217978306488.tar.gz |
libparted: Check devpath before passing to strlen
Diffstat (limited to 'libparted/arch/linux.c')
-rw-r--r-- | libparted/arch/linux.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index 758d36a..430d02e 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -2453,6 +2453,9 @@ _device_get_part_path (PedDevice const *dev, int num) #else devpath = dev->path; #endif + if (!devpath) + return NULL; + path_len = strlen (devpath); /* Check for devfs-style /disc => /partN transformation unconditionally; the system might be using udev with devfs rules, |