aboutsummaryrefslogtreecommitdiff
path: root/libbb/pw_encrypt.c
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2003-05-26 14:07:50 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2003-05-26 14:07:50 +0000
commit393183dccc4d100366972bdbbdc6e03a77839120 (patch)
treed2e94dac0f1f5da5cb3ecb927b78c4c2a02f4ea6 /libbb/pw_encrypt.c
parentddfe18df75c15be4a2aadddb241c3b86b1e2968a (diff)
downloadbusybox-393183dccc4d100366972bdbbdc6e03a77839120.tar.gz
Vodz, last_patch_86
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)
/* if crypt (a nonstandard crypt) returns a string too large,
truncate it so we don't overrun buffers and hope there is
enough security in what's left */
- if (strlen(cp) > sizeof(cipher)-1) {
- cp[sizeof(cipher)-1] = 0;
- }
- strcpy(cipher, cp);
+ safe_strncpy(cipher, cp, sizeof(cipher));
return cipher;
}