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/+/2234?usp=email

to review the following change.


Change subject: openvpnserv: fix reading DHCPv6 name servers
......................................................................

openvpnserv: fix reading DHCPv6 name servers

GetItfDnsServersV6() treated a successful inet_ntop() as failure and
returned ERROR_MORE_DATA after converting the first address. So DHCPv6
name servers of an interface were never used for the NRPT exclude
rules.

Fix the check. As the loop now gets to further addresses, also make
sure there is room for more than the terminating zero before a
separator is added.

Change-Id: I1d36996218c3c61f1f16e2c97f922afa66df6b66
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/34/2234/1

diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c
index 24705a9..32b1688 100644
--- a/src/openvpnserv/interactive.c
+++ b/src/openvpnserv/interactive.c
@@ -2256,7 +2256,12 @@
         {
             if (i != 0)
             {
-                /* Add separator */
+                /* Add separator, if there is room for more than the 
terminator */
+                if (s < 2)
+                {
+                    *size = 0;
+                    return ERROR_MORE_DATA;
+                }
                 *pos++ = ',';
                 s--;
             }

--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2234?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: I1d36996218c3c61f1f16e2c97f922afa66df6b66
Gerrit-Change-Number: 2234
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