Skip to content

Commit

Permalink
fix null termination on decrypt function
Browse files Browse the repository at this point in the history
  • Loading branch information
wuriyanto48 committed Aug 31, 2023
1 parent f069684 commit 92e7be6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crypsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 92e7be6

Please sign in to comment.