From 393183dccc4d100366972bdbbdc6e03a77839120 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Mon, 26 May 2003 14:07:50 +0000 Subject: Vodz, last_patch_86 --- libbb/pw_encrypt.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'libbb/pw_encrypt.c') 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; } -- cgit v1.2.3