listen_low_port: check for errors from socket(2) before continuing
MFC after: 3 days Reported by: Coverity CID: 976778
This commit is contained in:
parent
2020383ffd
commit
619898777b
@ -110,6 +110,9 @@ ATF_TC_BODY(listen_low_port, tc)
|
||||
int sd, val;
|
||||
|
||||
sd = socket(AF_INET, SOCK_STREAM, 0);
|
||||
#ifdef __FreeBSD__
|
||||
ATF_REQUIRE_MSG(sd != -1, "socket failed: %s", strerror(errno));
|
||||
#endif
|
||||
|
||||
val = IP_PORTRANGE_LOW;
|
||||
if (setsockopt(sd, IPPROTO_IP, IP_PORTRANGE, &val,
|
||||
|
Loading…
x
Reference in New Issue
Block a user