]> git.feebdaed.xyz Git - 0xmirror/openvpn.git/commitdiff
iservice: make sure buffer size is not zero
authorHeiko Hund <heiko@ist.eigentlich.net>
Sun, 23 Nov 2025 11:37:42 +0000 (12:37 +0100)
committerGert Doering <gert@greenie.muc.de>
Sun, 23 Nov 2025 13:18:03 +0000 (14:18 +0100)
GetItfDnsDomains expects a non-zero size buffer to return the domains
in. Check for the size as well, not just for a valid pointer.

Change-Id: I8b26c65415f5a751f416d80a22cbb7ff14aa27c0
Reported-by: Marc Heuse <marc@srlabs.de>
Reported-by: stephan@srlabs.de
Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1389
Message-Id: <20251123113747.17739-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34606.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
src/openvpnserv/interactive.c

index f64c24725b7f7feb5c97141487d6c1238397b8a6..d778e8984a32219c65bc6b4d312cc24dc2993393 100644 (file)
@@ -2149,7 +2149,7 @@ ListContainsDomain(PCWSTR list, PCWSTR domain, size_t len)
 static LSTATUS
 GetItfDnsDomains(HKEY itf, PCWSTR search_domains, PWSTR domains, PDWORD size)
 {
-    if (domains == NULL || size == 0)
+    if (domains == NULL || size == NULL || *size == 0)
     {
         return ERROR_INVALID_PARAMETER;
     }