Index | Thread | Search

From:
Theo Buehler <tb@theobuehler.org>
Subject:
Re: init imsg hdr len in imsg_create()
To:
tech@openbsd.org
Date:
Mon, 16 Jun 2025 15:36:07 +0200

Download raw body.

Thread
On Mon, Jun 16, 2025 at 03:34:18PM +0200, Claudio Jeker wrote:
> 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.

I came to the same conclusion.

ok tb

> 
> -- 
> :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)
>