From cb56eaeaed2b7c44d5fd87bd1c21f1abe813f668 Mon Sep 17 00:00:00 2001 From: Janos SUTO Date: Wed, 6 Jan 2021 08:36:50 +0100 Subject: [PATCH] Reset buffer in make_digests() Signed-off-by: Janos SUTO --- src/digest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/digest.c b/src/digest.c index 5af1fa53..6899dba1 100644 --- a/src/digest.c +++ b/src/digest.c @@ -48,6 +48,7 @@ int make_digests(struct session_data *sdata, struct config *cfg){ fd = open(sdata->filename, O_RDONLY); if(fd == -1) return -1; + memset(buf, 0, sizeof(buf)); while((n = read(fd, buf, sizeof(buf))) > 0){ SHA256_Update(&context2, buf, n);