Skip to content

Commit c0cb510

Browse files
d12fkcron2
authored andcommitted
iservice: handle ignoring itf domains correctly
GetItfDnsDomains() does ignore domains, which are in the search domains list. Handling of this was done wrong if there was more than one interface domain. In any case the size returned to the caller was calculated wrong. Reported-by: Marc Heuse <marc@srlabs.de> Reported-by: stephan@srlabs.de Change-Id: I02e2c7b27b5a39b11556e4753c648baa05344ffc 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/+/1394 Message-Id: <20251126104706.5378-1-gert@greenie.muc.de> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg34677.html Signed-off-by: Gert Doering <gert@greenie.muc.de>
1 parent aeda359 commit c0cb510

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/openvpnserv/interactive.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,14 +2190,16 @@ GetItfDnsDomains(HKEY itf, PCWSTR search_domains, PWSTR domains, PDWORD size)
21902190
{
21912191
if (comma)
21922192
{
2193-
pos = comma + 1;
2193+
/* Overwrite the ignored domain with remaining one(s) */
2194+
memmove(pos, comma + 1, buf_size - converted_size);
2195+
*size -= domain_size + one_glyph;
21942196
continue;
21952197
}
21962198
else
21972199
{
21982200
/* This was the last domain */
21992201
*pos = '\0';
2200-
*size += one_glyph;
2202+
*size -= domain_size;
22012203
return wcslen(domains) ? NO_ERROR : ERROR_FILE_NOT_FOUND;
22022204
}
22032205
}

0 commit comments

Comments
 (0)