https://bugs.winehq.org/show_bug.cgi?id=54998
Bug ID: 54998 Summary: DnsQuery(DNS_TYPE_SRV) fails to parse some of the server answers Product: Wine Version: 8.9 Hardware: x86-64 OS: Linux Status: NEW Keywords: patch, source Severity: normal Priority: P2 Component: dnsapi Assignee: wine-bugs@winehq.org Reporter: dmitry@baikal.ru Distribution: ---
Created attachment 74551 --> https://bugs.winehq.org/attachment.cgi?id=74551 patch
An application that uses ActiveDs sometimes fails to get domain DC using DsGetDcNameW(). That's caused by a failing call to DnsQuery("_ldap._tcp.dc._msdcs.domain.com", DNS_TYPE_SRV) which in turn fails because DnsExtractRecordsFromMessage_UTF8() fails to parse some of the server answers.
It looks like this happens because in the DNS_TYPE_SRV record name is the last element, and in that case get_name() uses wrong boundary check and returns NULL.
Just in case it will be useful I'm attaching my version of the fix with some tests.
It seems that skip_name() also uses wrong boundary check, however usually some other data follows the skipped name, so it currently doesn't cause failures.
https://bugs.winehq.org/show_bug.cgi?id=54998
Vitaly Lipatov lav@etersoft.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lav@etersoft.ru
https://bugs.winehq.org/show_bug.cgi?id=54998
--- Comment #1 from Hans Leidekker hans@meelstraat.net --- Looks good. Would you mind creating a merge request?
https://bugs.winehq.org/show_bug.cgi?id=54998
--- Comment #2 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to Hans Leidekker from comment #1)
Looks good. Would you mind creating a merge request?
Feel free to take care of this. Thanks.
https://bugs.winehq.org/show_bug.cgi?id=54998
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Fixed by SHA1| |a36e0a16cd6f4329beec1d2fa83 | |428575269540f Resolution|--- |FIXED
--- Comment #3 from Dmitry Timoshkov dmitry@baikal.ru --- Fix was commited as a36e0a16cd6f4329beec1d2fa83428575269540f.
https://bugs.winehq.org/show_bug.cgi?id=54998
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 8.16.