summaryrefslogtreecommitdiffstats
path: root/usr.sbin/bhyve
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2015-09-17 18:11:26 +0000
committerdelphij <delphij@FreeBSD.org>2015-09-17 18:11:26 +0000
commit45de05604807779a942c9ec68c311a48ced3fe8c (patch)
tree2b0dec2679ab8d2f8ad64bd52ed1e61e1ea32bb6 /usr.sbin/bhyve
parente1d666709add69e84b5808ec4253f75315725a4d (diff)
downloadFreeBSD-src-45de05604807779a942c9ec68c311a48ced3fe8c.zip
FreeBSD-src-45de05604807779a942c9ec68c311a48ced3fe8c.tar.gz
Use strlcpy() instead of strncpy() because subsequent mkstemps expects
the string be nul-terminated. Reviewed by: neel MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D3685
Diffstat (limited to 'usr.sbin/bhyve')
-rw-r--r--usr.sbin/bhyve/acpi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/bhyve/acpi.c b/usr.sbin/bhyve/acpi.c
index a9dd1cc..57fe783 100644
--- a/usr.sbin/bhyve/acpi.c
+++ b/usr.sbin/bhyve/acpi.c
@@ -790,10 +790,10 @@ basl_open(struct basl_fio *bf, int suffix)
err = 0;
if (suffix) {
- strncpy(bf->f_name, basl_stemplate, MAXPATHLEN);
+ strlcpy(bf->f_name, basl_stemplate, MAXPATHLEN);
bf->fd = mkstemps(bf->f_name, strlen(BHYVE_ASL_SUFFIX));
} else {
- strncpy(bf->f_name, basl_template, MAXPATHLEN);
+ strlcpy(bf->f_name, basl_template, MAXPATHLEN);
bf->fd = mkstemp(bf->f_name);
}
OpenPOWER on IntegriCloud