aboutsummaryrefslogtreecommitdiff
path: root/providers/implementations/ciphers/cipher_null.c
diff options
context:
space:
mode:
Diffstat (limited to 'providers/implementations/ciphers/cipher_null.c')
-rw-r--r--providers/implementations/ciphers/cipher_null.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/providers/implementations/ciphers/cipher_null.c b/providers/implementations/ciphers/cipher_null.c
index 0df97a7f8bc3..7e934093ce5a 100644
--- a/providers/implementations/ciphers/cipher_null.c
+++ b/providers/implementations/ciphers/cipher_null.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2020-2021 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2020-2024 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -82,7 +82,7 @@ static int null_cipher(void *vctx, unsigned char *out, size_t *outl,
}
if (outsize < inl)
return 0;
- if (in != out)
+ if (out != NULL && in != out)
memcpy(out, in, inl);
*outl = inl;
return 1;
@@ -193,5 +193,5 @@ const OSSL_DISPATCH ossl_null_functions[] = {
{ OSSL_FUNC_CIPHER_SET_CTX_PARAMS, (void (*)(void))null_set_ctx_params },
{ OSSL_FUNC_CIPHER_SETTABLE_CTX_PARAMS,
(void (*)(void))null_settable_ctx_params },
- { 0, NULL }
+ OSSL_DISPATCH_END
};