From: Michael Vrable Date: Fri, 22 Jan 2010 05:18:05 +0000 (-0800) Subject: Fix a nasty bug in the decryption code. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=5f2b6416e93119d1896f5fcf703af81a292cd2ad;p=bluesky.git 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. --- 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); }