X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=apps%2Fpasswd.c;h=f0ab24358010acac348767f5ebf2cc88f3374254;hp=2a32111e9d92adec3c73b1ecff57ec8a21fd6da6;hb=04f6b0fd9110c85c3c0d6d1172005d1c6755ac86;hpb=bfb0641f932490c2e7fb5f9f7cb4a88017a5abfa diff --git a/apps/passwd.c b/apps/passwd.c index 2a32111e9d..f0ab243580 100644 --- a/apps/passwd.c +++ b/apps/passwd.c @@ -314,9 +314,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); + OPENSSL_strlcat(out_buf, magic, sizeof out_buf); + OPENSSL_strlcat(out_buf, "$", sizeof out_buf); + OPENSSL_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);