aboutsummaryrefslogtreecommitdiff
path: root/libbb/pw_encrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/pw_encrypt.c')
-rw-r--r--libbb/pw_encrypt.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/libbb/pw_encrypt.c b/libbb/pw_encrypt.c
index 0e4eb9f8a..ac79f839f 100644
--- a/libbb/pw_encrypt.c
+++ b/libbb/pw_encrypt.c
@@ -39,10 +39,7 @@ extern char *pw_encrypt(const char *clear, const char *salt)
39 /* if crypt (a nonstandard crypt) returns a string too large, 39 /* if crypt (a nonstandard crypt) returns a string too large,
40 truncate it so we don't overrun buffers and hope there is 40 truncate it so we don't overrun buffers and hope there is
41 enough security in what's left */ 41 enough security in what's left */
42 if (strlen(cp) > sizeof(cipher)-1) { 42 safe_strncpy(cipher, cp, sizeof(cipher));
43 cp[sizeof(cipher)-1] = 0;
44 }
45 strcpy(cipher, cp);
46 return cipher; 43 return cipher;
47} 44}
48 45