summaryrefslogtreecommitdiffstats
path: root/pw/pw_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r--pw/pw_user.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c
index 5466bec..cf38e9c 100644
--- a/pw/pw_user.c
+++ b/pw/pw_user.c
@@ -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 *