summaryrefslogtreecommitdiff
path: root/disk/part.c
diff options
context:
space:
mode:
Diffstat (limited to 'disk/part.c')
-rw-r--r--disk/part.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/disk/part.c b/disk/part.c
index 5e7e59cf25..086da84b7f 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -714,7 +714,11 @@ static int part_get_info_by_dev_and_name(const char *dev_iface,
int ret;
/* Separate device and partition name specification */
- part_str = strchr(dev_part_str, '#');
+ if (dev_part_str)
+ part_str = strchr(dev_part_str, '#');
+ else
+ part_str = NULL;
+
if (part_str) {
dup_str = strdup(dev_part_str);
dup_str[part_str - dev_part_str] = 0;