From: Gert Doering Date: Tue, 28 Oct 2025 20:31:50 +0000 (+0100) Subject: zeroize struct image in packet_id_persist_save() before writing to disk X-Git-Tag: v2.7_rc1~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c58b6e73c3508b40b3d2f26eebfc3aa4df53e524;p=thirdparty%2Fopenvpn.git zeroize struct image in packet_id_persist_save() before writing to disk 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 Found-by: ZeroPath (https://zeropath.com/) Change-Id: I7f4c7b0ca748975defca1e5104e7077a761cd49c Signed-off-by: Gert Doering Acked-by: Frank Lichtenheld 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 --- diff --git a/src/openvpn/packet_id.c b/src/openvpn/packet_id.c index 880eee129..08d9d9b38 100644 --- a/src/openvpn/packet_id.c +++ b/src/openvpn/packet_id.c @@ -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();