From 6dec2ad700aac233ab001f91b8fa05813180eaba Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Sun, 21 Jan 2024 12:23:28 +0000 Subject: convert most of gmid to the new imsg APIs Makes parsing and handling of imsgs simpler / clearer. only crypto.c is left as-is. --- proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'proc.c') diff --git a/proc.c b/proc.c index 50cabc7..7e160a8 100644 --- a/proc.c +++ b/proc.c @@ -671,8 +671,8 @@ proc_dispatch(int fd, short event, void *arg) */ switch (imsg.hdr.type) { case IMSG_CTL_PROCFD: - IMSG_SIZE_CHECK(&imsg, &pf); - memcpy(&pf, imsg.data, sizeof(pf)); + if (imsg_get_data(&imsg, &pf, sizeof(pf))) + fatalx("bad length imsg CTL_PROCFD"); proc_accept(ps, imsg_get_fd(&imsg), pf.pf_procid, pf.pf_instance); break; -- cgit v1.2.3