mirror of
https://github.com/OpenVPN/openvpn.git
synced 2024-09-19 19:42:30 +02:00
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 There is only one caller (link_socket_init_phase2) and it already has an ASSERT(sig_info). So use that here was well. v2: - fix cleanly by actually asserting that sig_info is defined Change-Id: I8ef199463d46303129a3f563fd9eace780a58b8a Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org> Message-Id: <20240325071448.12143-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28452.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
This commit is contained in:
parent
6a60d1bef4
commit
e8c629fe64
@ -2005,7 +2005,8 @@ static void
|
||||
phase2_tcp_server(struct link_socket *sock, const char *remote_dynamic,
|
||||
struct signal_info *sig_info)
|
||||
{
|
||||
volatile int *signal_received = sig_info ? &sig_info->signal_received : NULL;
|
||||
ASSERT(sig_info);
|
||||
volatile int *signal_received = &sig_info->signal_received;
|
||||
switch (sock->mode)
|
||||
{
|
||||
case LS_MODE_DEFAULT:
|
||||
@ -2031,7 +2032,7 @@ phase2_tcp_server(struct link_socket *sock, const char *remote_dynamic,
|
||||
false);
|
||||
if (!socket_defined(sock->sd))
|
||||
{
|
||||
register_signal(sig_info, SIGTERM, "socket-undefiled");
|
||||
register_signal(sig_info, SIGTERM, "socket-undefined");
|
||||
return;
|
||||
}
|
||||
tcp_connection_established(&sock->info.lsa->actual);
|
||||
|
Loading…
Reference in New Issue
Block a user