Skip to content

Commit

Permalink
Fix some uninitialized pointers in crypto
Browse files Browse the repository at this point in the history
crypto.c:2748:9: warning: variable 'bn_prime' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
    if (!get_bn_from_bin(env, argv[0], &bn_verifier)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crypto.c:2758:6: note: uninitialized use occurs here
        if (bn_prime) BN_free(bn_prime);
            ^~~~~~~~
crypto.c:2748:9: note: remove the '||' if its condition is always false
    if (!get_bn_from_bin(env, argv[0], &bn_verifier)
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • Loading branch information
nox authored and sverker committed Nov 21, 2013
1 parent c01df22 commit 5fec852
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/crypto/c_src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -2658,8 +2658,9 @@ static ERL_NIF_TERM srp_user_secret_nif(ErlNifEnv* env, int argc, const ERL_NIF_
<premaster secret> = (B - (k * g^x)) ^ (a + (u * x)) % N
*/
BIGNUM *bn_exponent = NULL, *bn_a = NULL;
BIGNUM *bn_u, *bn_multiplier, *bn_exp2, *bn_base,
*bn_prime, *bn_generator, *bn_B, *bn_result;
BIGNUM *bn_u = NULL, *bn_multiplier = NULL, *bn_exp2,
*bn_base, *bn_prime = NULL, *bn_generator = NULL,
*bn_B = NULL, *bn_result;
BN_CTX *bn_ctx;
unsigned char* ptr;
unsigned dlen;
Expand Down

0 comments on commit 5fec852

Please sign in to comment.