Skip to content

Commit aeda359

Browse files
d12fkcron2
authored andcommitted
iservice: return correct size when domains are truncated
In case not all domains can be converted in the available buffer, return the size of the already converted domains size plus the second terminating zero for the MULTI_SZ. Reported-by: Marc Heuse <marc@srlabs.de> Reported-by: stephan@srlabs.de Change-Id: Iabad046c930dd0f38ec50d1c43d8b3288816df7d 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/+/1391 Message-Id: <20251126104315.4776-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34680.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
1 parent ac6c9d6 commit aeda359

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/openvpnserv/interactive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2214,7 +2214,7 @@ GetItfDnsDomains(HKEY itf, PCWSTR search_domains, PWSTR domains, PDWORD size)
22142214
{
22152215
/* Domain doesn't fit, bad luck if it's the first one */
22162216
*pos = '\0';
2217-
*size = converted_size == 0 ? 0 : *size + 1;
2217+
*size = converted_size == 0 ? 0 : converted_size + one_glyph;
22182218
return ERROR_MORE_DATA;
22192219
}
22202220

0 commit comments

Comments
 (0)