* cipher/ecc-eddsa.c (_gcry_ecc_eddsa_ensure_compact): Initialize
ENC and ENCLEN before use.

--

Signed-off-by: NIIBE Yutaka <gni...@fsij.org>
---
 cipher/ecc-eddsa.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c
index ce79b48e..fb952baf 100644
--- a/cipher/ecc-eddsa.c
+++ b/cipher/ecc-eddsa.c
@@ -154,8 +154,6 @@ _gcry_ecc_eddsa_ensure_compact (gcry_mpi_t value, unsigned int nbits)
   const unsigned char *buf;
   unsigned int rawmpilen;
   gcry_mpi_t x, y;
-  unsigned char *enc;
-  unsigned int enclen;
 
   if (!mpi_is_opaque (value))
     return GPG_ERR_INV_OBJ;
@@ -168,6 +166,9 @@ _gcry_ecc_eddsa_ensure_compact (gcry_mpi_t value, unsigned int nbits)
     {
       if (buf[0] == 0x04)
         {
+          unsigned char *enc = NULL;
+          unsigned int enclen = 0;
+
           /* Buffer is in SEC1 uncompressed format.  Extract y and
              compress.  */
           rc = _gcry_mpi_scan (&x, GCRYMPI_FMT_USG,
_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gcrypt-devel

Reply via email to