Attention is currently required from: flichtenheld.
Hello flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/770?usp=email
to review the following change.
Change subject: Fix socketpair return status not being checked in port share
code
......................................................................
Fix socketpair return status not being checked in port share code
found by Coverity after tun_afunix introduced another call to
socketpair, so it started to complain that we only check the
return code in 4 of 5 cases.
Change-Id: Id99a3ba13c0f1d0bc7e4699fb67ee9dff6221639
---
M src/openvpn/ps.c
1 file changed, 7 insertions(+), 1 deletion(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/70/770/1
diff --git a/src/openvpn/ps.c b/src/openvpn/ps.c
index 4ca3a12..129f65c 100644
--- a/src/openvpn/ps.c
+++ b/src/openvpn/ps.c
@@ -234,7 +234,12 @@
}
else
{
- socketpair(PF_UNIX, SOCK_DGRAM, 0, sd_null);
+ if (!socketpair(AF_UNIX, SOCK_DGRAM, 0, sd_null))
+ {
+ msg(M_WARN|M_ERRNO, "PORT SHARE: socketpair failed -- unable
to communicate with background process "
+ "(%d, %d)", sd, sd_send);
+ goto done;
+ }
memcpy(CMSG_DATA(h), &sd_null[0], sizeof(sd_null[0]));
}
@@ -246,6 +251,7 @@
);
}
+done:
close_socket_if_defined(sd_null[0]);
close_socket_if_defined(sd_null[1]);
free(mesg.msg_control);
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/770?usp=email
To unsubscribe, or for help writing mail filters, visit
http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Id99a3ba13c0f1d0bc7e4699fb67ee9dff6221639
Gerrit-Change-Number: 770
Gerrit-PatchSet: 1
Gerrit-Owner: plaisthos <[email protected]>
Gerrit-Reviewer: flichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel