]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
apps/passwd.c: Convert a redundant check to assert
authorBartel Artem <artem.bartel@gmail.com>
Mon, 25 Nov 2024 11:28:05 +0000 (14:28 +0300)
committerTomas Mraz <tomas@openssl.org>
Fri, 29 Nov 2024 13:33:30 +0000 (14:33 +0100)
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Paul Yang <kaishen.yy@antfin.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26053)

apps/passwd.c

index 31c7077ccc41350320f399edfd5f103709129954..8b233538d87b49f38613d3d9ddb04b15a572b91d 100644 (file)
@@ -369,8 +369,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
     if (magic_len > 0)
         salt_out += 2 + magic_len;
 
-    if (salt_len > 8)
-        goto err;
+    assert(salt_len <= 8);
 
     md = EVP_MD_CTX_new();
     if (md == NULL