From 4a6f0625cd11d9b615073565cb84e7b5da1b4b2c Mon Sep 17 00:00:00 2001 From: def Date: Tue, 17 Sep 2019 16:42:18 +0300 Subject: [PATCH] Fix uninitialized codec->pagesize (#26) Caused rekeying to fail after decrypting the whole database. --- sqleet.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sqleet.c b/sqleet.c index 2186a56..ee08ea1 100644 --- a/sqleet.c +++ b/sqleet.c @@ -53,7 +53,10 @@ Codec *codec_new(const void *zKey, int nKey, Codec *from) codec->kdf = from->kdf; } else { codec->reader = codec->writer = codec; + memset(codec->key, 0, sizeof(codec->key)); + memset(codec->salt, 0, sizeof(codec->salt)); codec->flags = 0; + codec->pagesize = 0; } codec->pagebuf = NULL; codec->zKey = zKey;