From: Heiko Hund <[email protected]>

GetItfDnsServersV6() added a separator between addresses even if only
the terminating zero still fit into the buffer, overwriting it, and
relied on inet_ntop() failing with a zero size buffer afterwards.

Return ERROR_MORE_DATA before adding the separator instead.

Change-Id: I1d36996218c3c61f1f16e2c97f922afa66df6b66
Signed-off-by: Heiko Hund <[email protected]>
Acked-by: Razvan Cojocaru <[email protected]>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2234
---

This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2234
This mail reflects revision 2 of this Change.

Acked-by according to Gerrit (reflected above):
Razvan Cojocaru <[email protected]>

        
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--;
             }


_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Reply via email to