From: "flichtenheld (Code Review)" Date: Tue, 9 Jan 2024 11:09:01 +0000 References: Reply-To: frank@...2641..., arne-openvpn@...1227..., openvpn-devel@lists.sourceforge.net Message-ID: <8094f36bd4c0f3bde973bb1b4c8d206604bac081-HTML@...2715...> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Type: multipart/alternative; boundary="SwqK8GKvcgo="; charset=UTF-8 Subject: [Openvpn-devel] [XS] Change in openvpn[master]: phase2_tcp_server: fix Coverity issue "Dereference after null check" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: plaisthos Cc: openvpn-devel --SwqK8GKvcgo= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Attention is currently required from: plaisthos. Hello plaisthos, I'd like you to do a code review. Please visit http://gerrit.openvpn.net/c/openvpn/+/490?usp=3Demail to review the following change. Change subject: phase2_tcp_server: fix Coverity issue "Dereference after nu= ll check" ...................................................................... phase2_tcp_server: fix Coverity issue "Dereference after null check" As Coverity says: Either the check against null is unnecessary, or there may be a null pointer dereference. In phase2_tcp_server: Pointer is checked against null but then dereferenced anyway The check is probably not required since we have an ASSERT(sig_info) in the caller. But I really didn't want to remove the check. So make the code consistent instead. Change-Id: I8ef199463d46303129a3f563fd9eace780a58b8a Signed-off-by: Frank Lichtenheld --- M src/openvpn/socket.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/90/490/1 diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 480f4e5..c158de1 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -2031,7 +2031,10 @@ false); if (!socket_defined(sock->sd)) { - register_signal(sig_info, SIGTERM, "socket-undefiled"); + if (signal_received) + { + register_signal(sig_info, SIGTERM, "socket-undefined"); + } return; } tcp_connection_established(&sock->info.lsa->actual); -- To view, visit http://gerrit.openvpn.net/c/openvpn/+/490?usp=3Demail To unsubscribe, or for help writing mail filters, visit http://gerrit.openv= pn.net/settings Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: I8ef199463d46303129a3f563fd9eace780a58b8a Gerrit-Change-Number: 490 Gerrit-PatchSet: 1 Gerrit-Owner: flichtenheld Gerrit-Reviewer: plaisthos Gerrit-CC: openvpn-devel Gerrit-Attention: plaisthos Gerrit-MessageType: newchange --SwqK8GKvcgo= Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Attention is currently required from: plaisthos.

flichtenheld would like plaisthos to review this change.

Vi= ew Change

phase2_tcp_server: fix Coverity issue "Dereference after=
 null check"

As Coverity says:
Either the check against null= is unnecessary, or there may be a null
pointer dereference.
In phase= 2_tcp_server: Pointer is checked against null but then
dereferenced anyw= ay

The check is probably not required since we have an ASSERT(sig_in= fo)
in the caller. But I really didn't want to remove the check. So<= br>make the code consistent instead.

Change-Id: I8ef199463d46303129a= 3f563fd9eace780a58b8a
Signed-off-by: Frank Lichtenheld <frank@...2746...= ...>
---
M src/openvpn/socket.c
1 file changed, 4 insertions(+)= , 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn r=
efs/changes/90/490/1
diff --git a/src/openvpn/socket.c b/src/openvp=
n/socket.c
index 480f4e5..c158de1 100644
--= - a/src/openvpn/socket.c
+++ b/src/openvpn/socket.c<= br>@@ -2031,7 +2031,10 @@
= false);
if (!socket_defined(sock= ->sd))
{
- register_signal(sig_info, SIGTERM, "= ;socket-undefiled");
+ if (signal_received)
+ {
+ register_signal(sig_info, SIGTERM,= "socket-undefined");
+ }
return;
}
tcp_connection_esta= blished(&sock->info.lsa->actual);

To view, visit change 490. To unsubscribe, or for help writing mail filters= , visit settings.

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I8ef199463d46303129a3f563fd9= eace780a58b8a
Gerrit-Change-Number: 490
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <frank@...2723...= .>
Gerrit-Reviewer: plaisthos <arne-openvpn@...1186...= .1227...>
Gerrit-CC: openvpn-devel <openvpn-devel@...1484...= ts.sourceforge.net>
Gerrit-Attention: plaisthos <arne-openvpn@...220...= ..1227...>
Gerrit-MessageType: newchange
--SwqK8GKvcgo=--