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
This commit is contained in:
parent
ca04571419
commit
4bdf90c43c
@ -790,10 +790,10 @@ basl_open(struct basl_fio *bf, int suffix)
|
|||||||
err = 0;
|
err = 0;
|
||||||
|
|
||||||
if (suffix) {
|
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));
|
bf->fd = mkstemps(bf->f_name, strlen(BHYVE_ASL_SUFFIX));
|
||||||
} else {
|
} else {
|
||||||
strncpy(bf->f_name, basl_template, MAXPATHLEN);
|
strlcpy(bf->f_name, basl_template, MAXPATHLEN);
|
||||||
bf->fd = mkstemp(bf->f_name);
|
bf->fd = mkstemp(bf->f_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user