Gert Doering has submitted this change. ( 
https://gerrit.openvpn.net/c/openvpn/+/2127?usp=email )

Change subject: tun: return NULL when the second adapter info query fails
......................................................................

tun: return NULL when the second adapter info query fails

get_per_adapter_info() and get_interface_info_list() returned the
allocated but unfilled buffer when the second GetPerAdapterInfo() or
GetInterfaceInfo() call failed, so callers read uninitialized data.
Return NULL, as get_adapter_info_list() already does. All callers
check for it.

Change-Id: I2d677eeb6ae9186ede2aeb3c2e0c12d25c935fcd
Signed-off-by: Razvan Cojocaru <[email protected]>
Acked-by: Frank Lichtenheld <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2127
Message-Id: <[email protected]>
URL: 
https://lore.kernel.org/openvpn-devel/[email protected]
Signed-off-by: Gert Doering <[email protected]>
---
M src/openvpn/tun.c
1 file changed, 2 insertions(+), 0 deletions(-)




diff --git a/src/openvpn/tun.c b/src/openvpn/tun.c
index 225d8b1..7637dc0 100644
--- a/src/openvpn/tun.c
+++ b/src/openvpn/tun.c
@@ -4129,6 +4129,7 @@
             {
                 msg(M_INFO, "GetPerAdapterInfo #2 failed (status=%lu) : %s", 
status,
                     strerror_win32(status, gc));
+                pi = NULL;
             }
         }
     }
@@ -4158,6 +4159,7 @@
         {
             msg(M_INFO, "GetInterfaceInfo #2 failed (status=%lu) : %s", status,
                 strerror_win32(status, gc));
+            ii = NULL;
         }
     }
     return ii;

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2127?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I2d677eeb6ae9186ede2aeb3c2e0c12d25c935fcd
Gerrit-Change-Number: 2127
Gerrit-PatchSet: 2
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-Reviewer: Frank Lichtenheld <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to