Skip to content

Commit b95d0d5

Browse files
committed
Add more checks in other functions
1 parent 4c0a39b commit b95d0d5

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crypto/fipsmodule/cipher/cipher.c

+3
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void) {
8484
}
8585

8686
int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) {
87+
GUARD_PTR(c);
8788
if (c->cipher != NULL && c->cipher->cleanup) {
8889
c->cipher->cleanup(c);
8990
}
@@ -111,6 +112,7 @@ int EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, const EVP_CIPHER_CTX *in) {
111112
OPENSSL_PUT_ERROR(CIPHER, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
112113
return 0;
113114
}
115+
GUARD_PTR(out);
114116

115117
EVP_CIPHER_CTX_cleanup(out);
116118
OPENSSL_memcpy(out, in, sizeof(EVP_CIPHER_CTX));
@@ -142,6 +144,7 @@ int EVP_CIPHER_CTX_reset(EVP_CIPHER_CTX *ctx) {
142144
int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
143145
ENGINE *engine, const uint8_t *key, const uint8_t *iv,
144146
int enc) {
147+
GUARD_PTR(ctx);
145148
if (enc == -1) {
146149
enc = ctx->encrypt;
147150
} else {

0 commit comments

Comments
 (0)