diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-06-25 09:53:46 +0200 |
---|---|---|
committer | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2018-06-25 15:30:28 +0200 |
commit | da0bbdd62614df6d6a33f91142a3e72525f7186e (patch) | |
tree | 5b09891ddbd380baa27872f5e3534b4c5aedb364 /apps/passwd.c | |
parent | e78c4f531d44d2454ba44b9de615920d340e77ce (diff) |
Fix some more gcc-9 warnings [-Wstringop-truncation]
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/6586)
Diffstat (limited to 'apps/passwd.c')
-rw-r--r-- | apps/passwd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/passwd.c b/apps/passwd.c index 56e10ad3d8..718f0e0124 100644 --- a/apps/passwd.c +++ b/apps/passwd.c @@ -306,9 +306,9 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt) out_buf[0] = '$'; out_buf[1] = 0; assert(strlen(magic) <= 4); /* "1" or "apr1" */ - strncat(out_buf, magic, 4); - strncat(out_buf, "$", 1); - strncat(out_buf, salt, 8); + BUF_strlcat(out_buf, magic, sizeof(out_buf)); + BUF_strlcat(out_buf, "$", sizeof(out_buf)); + BUF_strlcat(out_buf, salt, sizeof(out_buf)); assert(strlen(out_buf) <= 6 + 8); /* "$apr1$..salt.." */ salt_out = out_buf + 2 + strlen(magic); salt_len = strlen(salt_out); |