]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
zeroize struct image in packet_id_persist_save() before writing to disk
authorGert Doering <gert@greenie.muc.de>
Tue, 28 Oct 2025 20:31:50 +0000 (21:31 +0100)
committerGert Doering <gert@greenie.muc.de>
Wed, 29 Oct 2025 07:09:13 +0000 (08:09 +0100)
while this really is only a debug function, ensuring that no uninitialized
heap content ends up in padding in the structure and thus to disk is good
practice.

Reported-by: Joshua Rogers <contact@joshua.hu>
Found-by: ZeroPath (https://zeropath.com/)
Change-Id: I7f4c7b0ca748975defca1e5104e7077a761cd49c
Signed-off-by: Gert Doering <gert@greenie.muc.de>
Acked-by: Frank Lichtenheld <frank@lichtenheld.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1323
Message-Id: <20251028203156.11697-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg33983.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpn/packet_id.c

index 880eee1299d2964f0eba07f4a0f9017a489c336e..08d9d9b38e6746cd165a6f22df13155d1824017a 100644 (file)
@@ -511,6 +511,7 @@ packet_id_persist_save(struct packet_id_persist *p)
         && (p->time != p->time_last_written || p->id != p->id_last_written))
     {
         struct packet_id_persist_file_image image;
+        CLEAR(image);
         ssize_t n;
         off_t seek_ret;
         struct gc_arena gc = gc_new();