Skip to content

Commit

Permalink
Issue-1185: Avoid 'may be used uninitialized' warning (#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth authored Sep 28, 2023
1 parent 1cb3d18 commit 305ec03
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crypto/fipsmodule/ec/simple_mul.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@ static void ec_GFp_mont_batch_get_window(const EC_GROUP *group,

// Negate if necessary.
EC_FELEM neg_Y;
// Initialize |out| to avoid "may be used uninitialized" warning below.
// https://github.com/aws/aws-lc/issues/1185
OPENSSL_memset(&neg_Y, 0, sizeof(EC_FELEM));
ec_felem_neg(group, &neg_Y, &out->Y);
crypto_word_t sign_mask = sign;
sign_mask = 0u - sign_mask;
Expand Down

0 comments on commit 305ec03

Please sign in to comment.