From c0f63905c74b3b0b168a9cf7903ebaec6564c24c Mon Sep 17 00:00:00 2001 From: Hyeonsik Song Date: Thu, 5 Jul 2018 10:45:37 +0900 Subject: [PATCH] odhcpd: Check if open the ioctl socket failed Signed-off-by: Hyeonsik Song --- src/odhcpd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/odhcpd.c b/src/odhcpd.c index 9ab849a..fe4dd73 100644 --- a/src/odhcpd.c +++ b/src/odhcpd.c @@ -91,6 +91,9 @@ int main(int argc, char **argv) ioctl_sock = socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC, 0); + if (ioctl_sock < 0) + return 4; + if ((urandom_fd = open("/dev/urandom", O_RDONLY | O_CLOEXEC)) < 0) return 4; -- 2.30.2