summaryrefslogtreecommitdiffstats
path: root/sys/geom/vinum
diff options
context:
space:
mode:
authorle <le@FreeBSD.org>2007-04-12 17:40:44 +0000
committerle <le@FreeBSD.org>2007-04-12 17:40:44 +0000
commit1652a41e4b9ce48931196652c9c82b2982168c05 (patch)
tree0c4f3a7bd06ec818f162ac1fe3b9fad6bb177fc2 /sys/geom/vinum
parent1732a594ac085a1d06fa3d70b32af6dab2659f88 (diff)
downloadFreeBSD-src-1652a41e4b9ce48931196652c9c82b2982168c05.zip
FreeBSD-src-1652a41e4b9ce48931196652c9c82b2982168c05.tar.gz
Avoid infinite loop if the device string given for a drive
only consists of "/". Submitted by: Ulf Lilleengen <lulf_AT_freebsd.org>
Diffstat (limited to 'sys/geom/vinum')
-rw-r--r--sys/geom/vinum/geom_vinum_share.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sys/geom/vinum/geom_vinum_share.c b/sys/geom/vinum/geom_vinum_share.c
index 1219f0e..e87fd68 100644
--- a/sys/geom/vinum/geom_vinum_share.c
+++ b/sys/geom/vinum/geom_vinum_share.c
@@ -403,12 +403,9 @@ gv_new_drive(int max, char *token[])
break;
}
ptr = token[j];
- if (*ptr == '/') {
- ptr++;
- while (*ptr != '/')
- ptr++;
- ptr++;
- }
+
+ if (strncmp(ptr, "/dev/", 5) == 0)
+ ptr += 5;
strncpy(d->device, ptr, GV_MAXDRIVENAME);
} else {
/* We assume this is the drive name. */
OpenPOWER on IntegriCloud