From a904cb8f3132ef191a2f3262e32ddd67e2cc82b0 Mon Sep 17 00:00:00 2001 From: manastasova Date: Mon, 13 Jan 2025 14:05:04 -0800 Subject: [PATCH] Init variable to avoid "may be used uninitialized" warning --- crypto/fipsmodule/ec/ec_montgomery.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crypto/fipsmodule/ec/ec_montgomery.c b/crypto/fipsmodule/ec/ec_montgomery.c index 92289a5ed4..83afca3ad0 100644 --- a/crypto/fipsmodule/ec/ec_montgomery.c +++ b/crypto/fipsmodule/ec/ec_montgomery.c @@ -335,7 +335,11 @@ void ec_GFp_mont_dbl(const EC_GROUP *group, EC_JACOBIAN *r, // Coq transcription and correctness proof: // // - EC_FELEM delta, gamma, beta, ftmp, ftmp2, tmptmp, alpha, fourbeta; + + // Initialize variables to avoid "may be used uninitialized" warning. + // https://github.com/aws/aws-lc/issues/1185 + EC_FELEM delta = {{0}}, gamma = {{0}}, beta = {{0}}, ftmp = {{0}}, ftmp2 = {{0}}, tmptmp = {{0}}, alpha = {{0}}, fourbeta = {{0}}; + // delta = z^2 ec_GFp_mont_felem_sqr(group, &delta, &a->Z); // gamma = y^2