From 5e16483034c1d00fa2342c16f3ef721ea64c61c1 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 12 Dec 2019 13:18:51 +0000 Subject: [PATCH] writer: Erase the padding We should not leak any data from the stack into the database and this makes debugging easier, too. Signed-off-by: Michael Tremer --- src/writer.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/writer.c b/src/writer.c index cf0ae32..6cd0027 100644 --- a/src/writer.c +++ b/src/writer.c @@ -615,6 +615,10 @@ LOC_EXPORT int loc_writer_write(struct loc_writer* writer, FILE* f) { for (unsigned int i = 0; i < sizeof(header.signature); i++) header.signature[i] = '\0'; + // Clear the padding + for (unsigned int i = 0; i < sizeof(header.padding); i++) + header.padding[i] = '\0'; + int r; off_t offset = 0; -- 2.47.3