Index | Thread | Search

From:
Claudio Jeker <cjeker@diehard.n-r-g.com>
Subject:
init imsg hdr len in imsg_create()
To:
tech@openbsd.org
Date:
Mon, 16 Jun 2025 15:34:18 +0200

Download raw body.

Thread
Coverity spotted that hdr.len is not initalized in imsg_create().
This is not really an issue since imsg_close() writes this information
before pushing the ibuf out. Still a good idea to set it I think.

-- 
:wq Claudio

diff --git imsg.c imsg.c
index f2e7e283a5f..d77608e9f0c 100644
--- imsg.c
+++ imsg.c
@@ -371,6 +371,7 @@ imsg_create(struct imsgbuf *imsgbuf, uint32_t type, uint32_t id, pid_t pid,
 		return (NULL);
 	}
 
+	hdr.len = 0;
 	hdr.type = type;
 	hdr.peerid = id;
 	if ((hdr.pid = pid) == 0)