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>
{
if (comma)
{
- pos = comma + 1;
+ /* Overwrite the ignored domain with remaining one(s) */
+ memmove(pos, comma + 1, buf_size - converted_size);
+ *size -= domain_size + one_glyph;
continue;
}
else
{
/* This was the last domain */
*pos = '\0';
- *size += one_glyph;
+ *size -= domain_size;
return wcslen(domains) ? NO_ERROR : ERROR_FILE_NOT_FOUND;
}
}