From 5c1bad0013204d70c5b60713af977bdaa5df1302 Mon Sep 17 00:00:00 2001 From: Ned Bass Date: Mon, 11 Oct 2010 14:48:52 -0700 Subject: [PATCH] Fix undersized buffer in is_shorthand_path() 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 --- cmd/zpool/zpool_vdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/zpool/zpool_vdev.c b/cmd/zpool/zpool_vdev.c index febdda95f4..d4838ad2dc 100644 --- a/cmd/zpool/zpool_vdev.c +++ b/cmd/zpool/zpool_vdev.c @@ -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/ */