ecc: Fix possible memory leakage in parameter check of eddsa.
authorWerner Koch <wk@gnupg.org>
Wed, 24 Oct 2018 07:50:17 +0000 (09:50 +0200)
committerWerner Koch <wk@gnupg.org>
Wed, 24 Oct 2018 07:50:17 +0000 (09:50 +0200)
* cipher/ecc-eddsa.c (_gcry_ecc_eddsa_verify): Fix mem leak.
--

GnuPG-bug-id: 4209
Signed-off-by: Werner Koch <wk@gnupg.org>
cipher/ecc-eddsa.c

index 813e030..89b708a 100644 (file)
@@ -760,7 +760,10 @@ _gcry_ecc_eddsa_verify (gcry_mpi_t input, ECC_public_key *pkey,
                                      pkey->E.p, pkey->E.a, pkey->E.b);
   b = ctx->nbits/8;
   if (b != 256/8)
-    return GPG_ERR_INTERNAL; /* We only support 256 bit. */
+    {
+      rc = GPG_ERR_INTERNAL; /* We only support 256 bit. */
+      goto leave;
+    }
 
   /* Decode and check the public key.  */
   rc = _gcry_ecc_eddsa_decodepoint (pk, ctx, &Q, &encpk, &encpklen);