[PATCH 2/2] cipher:ecc: Silence GCC 15 warning.
NIIBE Yutaka via Gcrypt-devel <[email protected]> Fri, 4 Jul 2025 09:58:06 +0900
| Newsgroups | gmane.comp.encryption.gpg.libgcrypt.devel |
|---|---|
| Message-ID | <f06e90f4137a3dfaead69c21a8993c3530e0d913.1751590666.git.gniibe@fsij.org> |
* cipher/ecc-eddsa.c (_gcry_ecc_eddsa_ensure_compact): Initialize ENC and ENCLEN before use. -- Signed-off-by: NIIBE Yutaka <[email protected]> --- cipher/ecc-eddsa.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) _______________________________________________ Gcrypt-devel mailing list [email protected] https://lists.gnupg.org/mailman/listinfo/gcrypt-devel
0002-cipher-ecc-Silence-GCC-15-warning.patch
(text/x-patch, 770 B)
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,