From 7aaf777c481602682efa92134512ceeb04bd0747 Mon Sep 17 00:00:00 2001 From: Stephen Lombardo Date: Fri, 16 Nov 2012 15:22:04 -0500 Subject: [PATCH] remove redundant memset calls --- src/crypto_impl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/crypto_impl.c b/src/crypto_impl.c index 2284ad40..11fb4268 100644 --- a/src/crypto_impl.c +++ b/src/crypto_impl.c @@ -247,7 +247,7 @@ int sqlcipher_cipher_ctx_init(cipher_ctx **iCtx) { *iCtx = (cipher_ctx *) sqlcipher_malloc(sizeof(cipher_ctx)); ctx = *iCtx; if(ctx == NULL) return SQLITE_NOMEM; - sqlcipher_memset(ctx, 0, sizeof(cipher_ctx)); + ctx->key = (unsigned char *) sqlcipher_malloc(EVP_MAX_KEY_LENGTH); ctx->hmac_key = (unsigned char *) sqlcipher_malloc(EVP_MAX_KEY_LENGTH); if(ctx->key == NULL) return SQLITE_NOMEM; @@ -534,7 +534,6 @@ int sqlcipher_codec_ctx_init(codec_ctx **iCtx, Db *pDb, Pager *pPager, sqlite3_f if(ctx == NULL) return SQLITE_NOMEM; - sqlcipher_memset(ctx, 0, sizeof(codec_ctx)); /* initialize all pointers and values to 0 */ ctx->pBt = pDb->pBt; /* assign pointer to database btree structure */ /* allocate space for salt data. Then read the first 16 bytes