Fix 'openssl passwd' with arguments -1 or -apr1
authorRichard Levitte <levitte@openssl.org>
Tue, 13 Sep 2016 20:48:35 +0000 (22:48 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 13 Sep 2016 22:30:50 +0000 (00:30 +0200)
RT#4674

Reviewed-by: Rich Salz <rsalz@openssl.org>
apps/passwd.c

index e2c90960e5409d0e6280fa0b6a2bf06afce7eaf6..a45245cd7ffb8f78cd1f37f13c371359676c012c 100644 (file)
@@ -319,6 +319,7 @@ static char *md5crypt(const char *passwd, const char *magic, const char *salt)
         || !EVP_DigestUpdate(md, magic, magic_len)
         || !EVP_DigestUpdate(md, "$", 1)
         || !EVP_DigestUpdate(md, salt_out, salt_len))
         || !EVP_DigestUpdate(md, magic, magic_len)
         || !EVP_DigestUpdate(md, "$", 1)
         || !EVP_DigestUpdate(md, salt_out, salt_len))
+        goto err;
 
     md2 = EVP_MD_CTX_new();
     if (md2 == NULL
 
     md2 = EVP_MD_CTX_new();
     if (md2 == NULL