Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix coverity issues, 497452, 497428, 497414, 497443, 497438 #628

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crypto/asn1/x_delegated_credential.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ DELEGATED_CREDENTIAL *DC_load_from_file_ex(const char *file,
BIO *bio_dc = NULL;
char *dc_hex_buf = NULL;
unsigned char *dc_buf = NULL;
size_t dc_hex_len, len;
int dc_hex_len, len;
size_t dc_buf_len;

dc_hex_buf = OPENSSL_malloc(DC_MAX_LEN);
Expand Down Expand Up @@ -233,7 +233,7 @@ DELEGATED_CREDENTIAL *DC_load_from_file_ex(const char *file,
*/
len = dc_hex_len / 2;

dc_buf = OPENSSL_malloc(len);
dc_buf = OPENSSL_malloc((size_t)len);
if (dc_buf == NULL) {
ERR_raise(ERR_LIB_ASN1, ERR_R_MALLOC_FAILURE);
goto err;
Expand Down
4 changes: 2 additions & 2 deletions ssl/record/ssl3_record_tls13.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ int tls13_enc(SSL *s, SSL3_RECORD *recs, size_t n_recs, int sending,
{
EVP_CIPHER_CTX *ctx;
unsigned char iv[EVP_MAX_IV_LENGTH], recheader[SSL3_RT_HEADER_LENGTH];
size_t ivlen, taglen, offset, loop, hdrlen;
size_t taglen, offset, loop, hdrlen;
unsigned char *staticiv;
unsigned char *seq;
int lenu, lenf;
int lenu, lenf, ivlen;
SSL3_RECORD *rec = &recs[0];
uint32_t alg_enc;
WPACKET wpkt;
Expand Down
3 changes: 3 additions & 0 deletions test/cmp_ctx_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ execute_CTX_##SETN##_##GETN##_##FIELD(OSSL_CMP_CTX_TEST_FIXTURE *fixture) \
} else { \
if (DUP && val1_read == val1) { \
TEST_error("first set did not dup the value"); \
val1_read = 0; \
res = 0; \
} \
if (DEFAULT(val1_read)) { \
Expand Down Expand Up @@ -422,6 +423,7 @@ execute_CTX_##SETN##_##GETN##_##FIELD(OSSL_CMP_CTX_TEST_FIXTURE *fixture) \
} else { \
if (DUP && val2_read == val2) { \
TEST_error("second set did not dup the value"); \
val2_read = 0; \
res = 0; \
} \
if (val2 == val1) { \
Expand Down Expand Up @@ -451,6 +453,7 @@ execute_CTX_##SETN##_##GETN##_##FIELD(OSSL_CMP_CTX_TEST_FIXTURE *fixture) \
} else { \
if (DUP && val3_read == val2_read) { \
TEST_error("third get did not create a new dup"); \
val3_read = 0; \
res = 0; \
} \
} \
Expand Down
Loading