mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
strcpy => strlcpy
Reported by: Coverity CID: 1006715 MFC after: 3 weeks Sponsored by: Spectra Logic Corp
This commit is contained in:
parent
2d8b61145c
commit
daccabe958
1 changed files with 3 additions and 1 deletions
|
|
@ -33,6 +33,7 @@ static const char rcsid[] =
|
|||
#include <sys/param.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <ctype.h>
|
||||
#include <dirent.h>
|
||||
#include <err.h>
|
||||
|
|
@ -501,7 +502,8 @@ pw_pwcrypt(char *password)
|
|||
cryptpw = crypt(password, salt);
|
||||
if (cryptpw == NULL)
|
||||
errx(EX_CONFIG, "crypt(3) failure");
|
||||
return strcpy(buf, cryptpw);
|
||||
assert(strlcpy(buf, cryptpw, sizeof(buf)) < sizeof(buf));
|
||||
return (buf);
|
||||
}
|
||||
|
||||
static char *
|
||||
|
|
|
|||
Loading…
Reference in a new issue