Commit 0cc49f36 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

dnsapi: Set correct wDataLength for DNS_TYPE_SRV records.

parent a36e0a16
......@@ -1046,6 +1046,10 @@ static DNS_STATUS extract_rdata( const BYTE *base, const BYTE *end, const BYTE *
if (!get_name( base, end, pos, name )) return DNS_ERROR_BAD_PACKET;
if (!(r->Data.SRV.pNameTarget = strdupX( name, in, out ))) return ERROR_NOT_ENOUGH_MEMORY;
r->wDataLength = sizeof(DNS_SRV_DATAA);
if (out == DnsCharSetUnicode)
r->wDataLength += (wcslen( (const WCHAR *)r->Data.SRV.pNameTarget ) + 1) * sizeof(WCHAR);
else
r->wDataLength += strlen( r->Data.SRV.pNameTarget ) + 1;
break;
case DNS_TYPE_HINFO:
......
......@@ -230,7 +230,6 @@ static void test_DnsExtractRecordsFromMessage(void)
ok( rec->Flags.S.Section == DnsSectionAnswer, "wrong section %u\n", rec->Flags.S.Section );
ok( rec->Flags.S.CharSet == DnsCharSetUtf8, "wrong charset %u\n", rec->Flags.S.CharSet );
ok( rec->wType == DNS_TYPE_SRV, "wrong type %u\n", rec->wType );
todo_wine
ok( rec->wDataLength == sizeof(DNS_SRV_DATAA) + strlen( "dc.winehq.org" ) + 1, "wrong len %u\n", rec->wDataLength );
ok( rec->dwTtl == 0x04050607, "wrong ttl %#lx\n", rec->dwTtl );
ok( !strcmp( rec->Data.SRV.pNameTarget, "dc.winehq.org"), "wrong target %s\n", rec->Data.SRV.pNameTarget );
......@@ -250,7 +249,6 @@ static void test_DnsExtractRecordsFromMessage(void)
ok( rec->Flags.S.Section == DnsSectionAnswer, "wrong section %u\n", rec->Flags.S.Section );
ok( rec->Flags.S.CharSet == DnsCharSetUtf8, "wrong charset %u\n", rec->Flags.S.CharSet );
ok( rec->wType == DNS_TYPE_SRV, "wrong type %u\n", rec->wType );
todo_wine
ok( rec->wDataLength == sizeof(DNS_SRV_DATAA) + strlen( "dc.winehq.org" ) + 1, "wrong len %u\n", rec->wDataLength );
ok( rec->dwTtl == 0x04050607, "wrong ttl %#lx\n", rec->dwTtl );
ok( !strcmp( rec->Data.SRV.pNameTarget, "dc.winehq.org"), "wrong target %s\n", rec->Data.SRV.pNameTarget );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment