Valgrind warnings removed: all changes were false-positive issues.
authorMaciej J. Karpiuk <m.karpiuk2@samsung.com>
Wed, 15 Oct 2014 14:24:28 +0000 (16:24 +0200)
committerMaciej J. Karpiuk <m.karpiuk2@samsung.com>
Tue, 17 Feb 2015 10:00:03 +0000 (11:00 +0100)
Change-Id: I7ff0e4e6ab21ab570fddc9a63432a399c4ed402b

src/manager/sqlcipher/sqlcipher.c

index 69e2822..0676c94 100644 (file)
@@ -13491,6 +13491,7 @@ int sqlcipher_codec_ctx_set_pagesize(codec_ctx *ctx, int size) {
      operations to avoid overhead of multiple memory allocations*/
   ctx->buffer = sqlcipher_malloc(size);
   if(ctx->buffer == NULL) return SQLCIPHER_NOMEM;
+  memset(ctx->buffer, 0, size);
 
   return SQLCIPHER_OK;
 }
@@ -13515,6 +13516,7 @@ int sqlcipher_codec_ctx_init(codec_ctx **iCtx, Db *pDb, Pager *pPager, sqlcipher
   ctx->kdf_salt_sz = FILE_HEADER_SZ;
   ctx->kdf_salt = sqlcipher_malloc(ctx->kdf_salt_sz);
   if(ctx->kdf_salt == NULL) return SQLCIPHER_NOMEM;
+  memset(ctx->kdf_salt, 0, ctx->kdf_salt_sz);
 
   /* allocate space for separate hmac salt data. We want the
      HMAC derivation salt to be different than the encryption