From 5167507a831fb411844aab99ba8888b20e416209 Mon Sep 17 00:00:00 2001 From: Matthias Konrath Date: Wed, 28 Aug 2019 12:14:40 +0200 Subject: [PATCH] Fixed the loadFileDICTIONARY_safe memset alignment. Thanks to @doegox for pointing that out. --- client/fileutils.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/fileutils.c b/client/fileutils.c index 1b2073ed2..500bb7ef8 100644 --- a/client/fileutils.c +++ b/client/fileutils.c @@ -691,8 +691,8 @@ int loadFileDICTIONARY_safe(const char *preferredName, void **pdata, uint8_t key if (*pdata == NULL) { return PM3_EFILE; } else { - // zero the new memeory (safety first) - memset(*pdata + counter, 0, block_size); + // zero the new memory (safety first) + memset(*pdata + allocation_size - block_size, 0, block_size); } }