Skip to content

Commit

Permalink
Merge pull request #629 from dongbeiouba/fix83/coverity_uninitialized…
Browse files Browse the repository at this point in the history
…_var

Fix coverity issues, uninitialized variables
  • Loading branch information
InfoHunter authored Jul 1, 2024
2 parents 0f30351 + 57b8f83 commit 97bbaea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/s_cb.c
Original file line number Diff line number Diff line change
Expand Up @@ -915,8 +915,8 @@ int generate_cookie_callback(SSL *ssl, unsigned char *cookie,
int verify_cookie_callback(SSL *ssl, const unsigned char *cookie,
unsigned int cookie_len)
{
unsigned char result[EVP_MAX_MD_SIZE];
unsigned int resultlength;
unsigned char result[EVP_MAX_MD_SIZE] = {0};
unsigned int resultlength = 0;

/* Note: we check cookie_initialized because if it's not,
* it cannot be valid */
Expand Down
1 change: 1 addition & 0 deletions crypto/ec/ecp_nistz256.c
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,7 @@ __owur static int ecp_nistz256_points_mul(const EC_GROUP *group,
return 0;
}

memset(&p, 0, sizeof(p));
BN_CTX_start(ctx);

if (scalar) {
Expand Down
2 changes: 2 additions & 0 deletions ssl/ssl_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -2169,6 +2169,7 @@ int SSL_shutdown(SSL *s)
if ((s->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) {
struct ssl_async_args args;

memset(&args, 0, sizeof(args));
args.s = s;
args.type = OTHERFUNC;
args.f.func_other = s->method->ssl_shutdown;
Expand Down Expand Up @@ -3864,6 +3865,7 @@ int SSL_do_handshake(SSL *s)
if ((s->mode & SSL_MODE_ASYNC) && ASYNC_get_current_job() == NULL) {
struct ssl_async_args args;

memset(&args, 0, sizeof(args));
args.s = s;

ret = ssl_start_async_job(s, &args, ssl_do_handshake_intern);
Expand Down

0 comments on commit 97bbaea

Please sign in to comment.