diff options
author | delphij <delphij@FreeBSD.org> | 2015-09-17 18:11:26 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2015-09-17 18:11:26 +0000 |
commit | 45de05604807779a942c9ec68c311a48ced3fe8c (patch) | |
tree | 2b0dec2679ab8d2f8ad64bd52ed1e61e1ea32bb6 /usr.sbin | |
parent | e1d666709add69e84b5808ec4253f75315725a4d (diff) | |
download | FreeBSD-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')
-rw-r--r-- | usr.sbin/bhyve/acpi.c | 4 |
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); } |