From: Miroslav Lichvar Date: Mon, 20 Apr 2020 13:42:45 +0000 (+0200) Subject: check return value of SCK_OpenUnixSocketPair() X-Git-Tag: 4.0-pre2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7fc5da5f8057a2e2d480b18901289710d17242c4;p=thirdparty%2Fchrony.git check return value of SCK_OpenUnixSocketPair() --- diff --git a/nts_ke_server.c b/nts_ke_server.c index 4a76f15c..32eb6857 100644 --- a/nts_ke_server.c +++ b/nts_ke_server.c @@ -663,6 +663,8 @@ NKS_Initialise(int scfilter_level) int sock_fd1, sock_fd2; sock_fd1 = SCK_OpenUnixSocketPair(0, &sock_fd2); + if (sock_fd1 < 0) + LOG_FATAL("Could not open socket pair"); for (i = 0; i < processes; i++) start_helper(i + 1, scfilter_level, sock_fd1, sock_fd2); diff --git a/privops.c b/privops.c index e999f366..98707173 100644 --- a/privops.c +++ b/privops.c @@ -644,6 +644,8 @@ PRV_StartHelper(void) LOG_FATAL("Helper already running"); sock_fd1 = SCK_OpenUnixSocketPair(SCK_FLAG_BLOCK, &sock_fd2); + if (sock_fd1 < 0) + LOG_FATAL("Could not open socket pair"); pid = fork(); if (pid < 0)