]> git.proxmox.com Git - mirror_zfs-debian.git/commitdiff
Fix undersized buffer in is_shorthand_path()
authorNed Bass <bass6@llnl.gov>
Mon, 11 Oct 2010 21:48:52 +0000 (14:48 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 12 Oct 2010 21:47:39 +0000 (14:47 -0700)
The string array 'char dirs[5][8]' was too small to accomodate the terminating
NUL character in "by-label". This change adds the needed additional byte.

Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
cmd/zpool/zpool_vdev.c

index febdda95f48bba4588af76a5ea5b3ace1dcb35be..d4838ad2dc5d0732742ff7db36a8cfd5426b21ff 100644 (file)
@@ -384,7 +384,7 @@ static int
 is_shorthand_path(const char *arg, char *path,
                   struct stat64 *statbuf, boolean_t *wholedisk)
 {
-       char dirs[5][8] = {"by-id", "by-label", "by-path", "by-uuid", "zpool"};
+       char dirs[5][9] = {"by-id", "by-label", "by-path", "by-uuid", "zpool"};
        int i, err;
 
        /* /dev/<name> */