From 2512169c9df862dffca77b165d946643319c56f5 Mon Sep 17 00:00:00 2001 From: wuriyanto Date: Thu, 31 Aug 2023 12:14:19 +0700 Subject: [PATCH] fix null termination on decrypt function --- crypsi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypsi.h b/crypsi.h index 9e33841..1992adb 100644 --- a/crypsi.h +++ b/crypsi.h @@ -591,7 +591,7 @@ static int crypsi_aes_cbc_decrypt(enum crypsi_aes_key aes_key_size, const unsign } memcpy(*dst, dst_tmp, plaintext_len); - // *dst[plaintext_len] = 0x0; + (*dst)[plaintext_len] = 0x0; *dst_len = plaintext_len; @@ -813,7 +813,7 @@ static int crypsi_aes_gcm_decrypt(enum crypsi_aes_key aes_key_size, const unsign } memcpy(*dst, dst_tmp, plaintext_len); - // *dst[plaintext_len] = 0x0; + (*dst)[plaintext_len] = 0x0; *dst_len = plaintext_len;