Attention is currently required from: Arne Schwabe.

Hello Arne Schwabe,

I'd like you to do a code review.
Please visit

    https://gerrit.openvpn.net/c/openvpn/+/2233?usp=email

to review the following change.


Change subject: openvpnserv: don't use stale data for NRPT exclude rules
......................................................................

openvpnserv: don't use stale data for NRPT exclude rules

If the last interface GetNrptExcludeData() looked at was not usable, its
entry was left with the domains set, and SetNrptExcludeRules() created
a rule from it. Clear the unused entry when done.

Change-Id: Ia359824eea8780805a59d19146740afe3630fa0c
Signed-off-by: Heiko Hund <[email protected]>
---
M src/openvpnserv/interactive.c
1 file changed, 6 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/33/2233/1

diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 354fe09..24705a9 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -2521,13 +2521,13 @@
 {
     HKEY v4_itfs = INVALID_HANDLE_VALUE;
     HKEY v6_itfs = INVALID_HANDLE_VALUE;
+    size_t i = 0;

     if (!GetInterfacesKey(AF_INET, &v4_itfs) || !GetInterfacesKey(AF_INET6, 
&v6_itfs))
     {
         goto out;
     }

-    size_t i = 0;
     DWORD enum_index = 0;
     while (i < data_size)
     {
@@ -2627,6 +2627,11 @@
     }

 out:
+    /* Clear data left by an interface that was not usable */
+    if (i < data_size)
+    {
+        ZeroMemory(&data[i], sizeof(data[i]));
+    }
     RegCloseKey(v6_itfs);
     RegCloseKey(v4_itfs);
 }

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

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ia359824eea8780805a59d19146740afe3630fa0c
Gerrit-Change-Number: 2233
Gerrit-PatchSet: 1
Gerrit-Owner: Heiko Hund <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to