diff options
author | ae <ae@FreeBSD.org> | 2012-08-15 09:18:49 +0000 |
---|---|---|
committer | ae <ae@FreeBSD.org> | 2012-08-15 09:18:49 +0000 |
commit | e96225dccbcdd2775ef28b26baf1d1f833b2dd97 (patch) | |
tree | 76b574a428fad27801babd190b06f3cb0350129a | |
parent | 68f6dc6efdbfecb39363c0eec89d0deda44f028e (diff) | |
download | FreeBSD-src-e96225dccbcdd2775ef28b26baf1d1f833b2dd97.zip FreeBSD-src-e96225dccbcdd2775ef28b26baf1d1f833b2dd97.tar.gz |
Explicitly terminate the string after strncpy(3).
-rw-r--r-- | sys/boot/zfs/zfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/boot/zfs/zfs.c b/sys/boot/zfs/zfs.c index d7ea878..baad8db 100644 --- a/sys/boot/zfs/zfs.c +++ b/sys/boot/zfs/zfs.c @@ -422,6 +422,7 @@ zfs_probe_partition(void *arg, const char *partname, ppa = (struct zfs_probe_args *)arg; strncpy(devname, ppa->devname, strlen(ppa->devname) - 1); + devname[strlen(ppa->devname) - 1] = '\0'; sprintf(devname, "%s%s:", devname, partname); pa.fd = open(devname, O_RDONLY); if (pa.fd == -1) |