From: Heiko Hund Date: Sun, 23 Nov 2025 11:37:42 +0000 (+0100) Subject: iservice: make sure buffer size is not zero X-Git-Tag: v2.7_rc3~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c20a960a338a2e6e7436260cdae4d6eef298cfb0;p=thirdparty%2Fopenvpn.git iservice: make sure buffer size is not zero 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 Reported-by: stephan@srlabs.de Signed-off-by: Heiko Hund Acked-by: Gert Doering 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 --- diff --git a/src/openvpnserv/interactive.c b/src/openvpnserv/interactive.c index f64c24725..d778e8984 100644 --- a/src/openvpnserv/interactive.c +++ b/src/openvpnserv/interactive.c @@ -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; }