Remove an NULL ptr deref in an error path
The |passwd| variable in the code can be NULL if it goes to the err label. Therefore we cannot call strlen on it without first checking that it is non NULL. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
This commit is contained in:
parent
e4693b4e2a
commit
d73ca3efa7
1 changed files with 2 additions and 1 deletions
|
@ -393,7 +393,8 @@ int srp_generate_client_master_secret(SSL *s)
|
|||
err:
|
||||
BN_clear_free(K);
|
||||
BN_clear_free(x);
|
||||
OPENSSL_clear_free(passwd, strlen(passwd));
|
||||
if (passwd != NULL)
|
||||
OPENSSL_clear_free(passwd, strlen(passwd));
|
||||
BN_clear_free(u);
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue