aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ffi/ffi_pk_op.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/ffi/ffi_pk_op.cpp')
-rw-r--r--src/lib/ffi/ffi_pk_op.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/ffi/ffi_pk_op.cpp b/src/lib/ffi/ffi_pk_op.cpp
index 0f18fca3e..5f2437a10 100644
--- a/src/lib/ffi/ffi_pk_op.cpp
+++ b/src/lib/ffi/ffi_pk_op.cpp
@@ -46,6 +46,8 @@ int botan_pk_op_encrypt_destroy(botan_pk_op_encrypt_t op)
int botan_pk_op_encrypt_output_length(botan_pk_op_encrypt_t op, size_t ptext_len, size_t* ctext_len)
{
+ if(ctext_len == nullptr)
+ return BOTAN_FFI_ERROR_NULL_POINTER;
return BOTAN_FFI_DO(Botan::PK_Encryptor, op, o, { *ctext_len = o.ciphertext_length(ptext_len); });
}
@@ -88,6 +90,8 @@ int botan_pk_op_decrypt_destroy(botan_pk_op_decrypt_t op)
int botan_pk_op_decrypt_output_length(botan_pk_op_decrypt_t op, size_t ctext_len, size_t* ptext_len)
{
+ if(ptext_len == nullptr)
+ return BOTAN_FFI_ERROR_NULL_POINTER;
return BOTAN_FFI_DO(Botan::PK_Decryptor, op, o, { *ptext_len = o.plaintext_length(ctext_len); });
}