From 5f2b6416e93119d1896f5fcf703af81a292cd2ad Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Thu, 21 Jan 2010 21:18:05 -0800 Subject: [PATCH] Fix a nasty bug in the decryption code. This was a typo but it led to various types of memory corruption; after decrypting the returned string was marked as being larger than it should have been--also meaning that the last bytes in the buffer were off in unallocated space. --- bluesky/crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bluesky/crypto.c b/bluesky/crypto.c index adf7d03..4490e8c 100644 --- a/bluesky/crypto.c +++ b/bluesky/crypto.c @@ -137,5 +137,5 @@ BlueSkyRCStr *bluesky_crypt_decrypt(BlueSkyRCStr *in, const uint8_t *key) gcry_cipher_close(handle); - return bluesky_string_new(out, in->len + CRYPTO_BLOCK_SIZE); + return bluesky_string_new(out, in->len - CRYPTO_BLOCK_SIZE); } -- 2.20.1