From aba2397e74a2eff55e2507c27ba31813d6b2a95e Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Wed, 17 Jun 2020 10:56:58 +0000 Subject: [PATCH] loader: r362262 did miss the pathlen check While we are checking the "/dev/" prefix, we can skip the paths shorter than this prefix. Sponsored by: Netflix, Klara Inc. --- stand/libsa/zfs/zfsimpl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stand/libsa/zfs/zfsimpl.c b/stand/libsa/zfs/zfsimpl.c index f78c9a1bc3d..8b1c9224049 100644 --- a/stand/libsa/zfs/zfsimpl.c +++ b/stand/libsa/zfs/zfsimpl.c @@ -1201,7 +1201,7 @@ vdev_init(uint64_t guid, const unsigned char *nvlist, vdev_t **vdevp) char prefix[] = "/dev/"; len = strlen(prefix); - if (memcmp(path, prefix, len) == 0) { + if (len < pathlen && memcmp(path, prefix, len) == 0) { path += len; pathlen -= len; } -- 2.45.0