Date: Wed, 17 Jun 2020 10:56:58 +0000 (UTC) From: Toomas Soome <tsoome@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362265 - head/stand/libsa/zfs Message-ID: <202006171056.05HAuwlj093026@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tsoome Date: Wed Jun 17 10:56:58 2020 New Revision: 362265 URL: https://svnweb.freebsd.org/changeset/base/362265 Log: 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. Modified: head/stand/libsa/zfs/zfsimpl.c Modified: head/stand/libsa/zfs/zfsimpl.c ============================================================================== --- head/stand/libsa/zfs/zfsimpl.c Wed Jun 17 10:50:55 2020 (r362264) +++ head/stand/libsa/zfs/zfsimpl.c Wed Jun 17 10:56:58 2020 (r362265) @@ -1201,7 +1201,7 @@ vdev_init(uint64_t guid, const unsigned char *nvlist, char prefix[] = "/dev/"; len = strlen(prefix); - if (memcmp(path, prefix, len) == 0) { + if (len < pathlen && memcmp(path, prefix, len) == 0) { path += len; pathlen -= len; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006171056.05HAuwlj093026>