1
0
mirror of https://github.com/openbsd/src.git synced 2026-05-01 09:37:02 +00:00

While in practice the ibuf_skip() call can not fail it is better to check

it. If the ibuf header can't be skipped it is better to not forward the
message and return an error.
Fix for CID 492354
OK tb@
This commit is contained in:
claudio
2026-03-02 20:07:58 +00:00
parent ab4874c493
commit a3e28f440d

View File

@@ -1,4 +1,4 @@
/* $OpenBSD: imsg.c,v 1.42 2025/06/16 13:56:11 claudio Exp $ */
/* $OpenBSD: imsg.c,v 1.43 2026/03/02 20:07:58 claudio Exp $ */
/*
* Copyright (c) 2023 Claudio Jeker <claudio@openbsd.org>
@@ -340,7 +340,8 @@ imsg_forward(struct imsgbuf *imsgbuf, struct imsg *msg)
size_t len;
ibuf_rewind(msg->buf);
ibuf_skip(msg->buf, sizeof(msg->hdr));
if (ibuf_skip(msg->buf, sizeof(msg->hdr)) == -1)
return (-1);
len = ibuf_size(msg->buf);
if ((wbuf = imsg_create(imsgbuf, msg->hdr.type, msg->hdr.peerid,