diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:35:21 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:35:21 +0000 |
commit | 33a588df978f85e7cafd5cb8ad0c0488cf1d643e (patch) | |
tree | 88ded2bf783bae19a2722770ae6e67891c2d7758 /sbin/slaacd/engine.c | |
parent | bc259033bc5d73dfddade6d795e9a972dda58fba (diff) |
Convert sbin and usr.bin to check for imsgbuf_init failure and add
imsgbuf_allow_fdpass where needed.
OK tb@
Diffstat (limited to 'sbin/slaacd/engine.c')
-rw-r--r-- | sbin/slaacd/engine.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/slaacd/engine.c b/sbin/slaacd/engine.c index f825bfb41ee..8f1bd038533 100644 --- a/sbin/slaacd/engine.c +++ b/sbin/slaacd/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.98 2024/11/21 13:21:34 claudio Exp $ */ +/* $OpenBSD: engine.c,v 1.99 2024/11/21 13:35:20 claudio Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -396,7 +396,9 @@ engine(int debug, int verbose) if ((iev_main = malloc(sizeof(struct imsgev))) == NULL) fatal(NULL); - imsgbuf_init(&iev_main->ibuf, 3); + if (imsgbuf_init(&iev_main->ibuf, 3) == -1) + fatal(NULL); + imsgbuf_allow_fdpass(&iev_main->ibuf); iev_main->handler = engine_dispatch_main; /* Setup event handlers. */ @@ -673,7 +675,8 @@ engine_dispatch_main(int fd, short event, void *bula) if (iev_frontend == NULL) fatal(NULL); - imsgbuf_init(&iev_frontend->ibuf, fd); + if (imsgbuf_init(&iev_frontend->ibuf, fd) == -1) + fatal(NULL); iev_frontend->handler = engine_dispatch_frontend; iev_frontend->events = EV_READ; |