Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a36e0a16
Commit
a36e0a16
authored
Jun 01, 2023
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Sep 04, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnsapi: Accept name records of exact size at the end of the packet.
Signed-off-by:
Dmitry Timoshkov
<
dmitry@baikal.ru
>
parent
c3c477b7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
9 deletions
+1
-9
record.c
dlls/dnsapi/record.c
+1
-1
record.c
dlls/dnsapi/tests/record.c
+0
-8
No files found.
dlls/dnsapi/record.c
View file @
a36e0a16
...
@@ -199,7 +199,7 @@ static const BYTE *get_name( const BYTE *base, const BYTE *end, const BYTE *ptr,
...
@@ -199,7 +199,7 @@ static const BYTE *get_name( const BYTE *base, const BYTE *end, const BYTE *ptr,
return
NULL
;
return
NULL
;
}
}
}
}
if
(
ptr
>
=
end
)
return
NULL
;
if
(
ptr
>
end
)
return
NULL
;
if
(
out
==
name
)
*
out
++
=
'.'
;
if
(
out
==
name
)
*
out
++
=
'.'
;
*
out
=
0
;
*
out
=
0
;
return
next
?
next
:
ptr
;
return
next
?
next
:
ptr
;
...
...
dlls/dnsapi/tests/record.c
View file @
a36e0a16
...
@@ -224,11 +224,8 @@ static void test_DnsExtractRecordsFromMessage(void)
...
@@ -224,11 +224,8 @@ static void test_DnsExtractRecordsFromMessage(void)
rec
=
NULL
;
rec
=
NULL
;
ret
=
DnsExtractRecordsFromMessage_UTF8
(
(
DNS_MESSAGE_BUFFER
*
)
msg_full_srv
,
sizeof
(
msg_full_srv
),
&
rec
);
ret
=
DnsExtractRecordsFromMessage_UTF8
(
(
DNS_MESSAGE_BUFFER
*
)
msg_full_srv
,
sizeof
(
msg_full_srv
),
&
rec
);
todo_wine
ok
(
!
ret
,
"failed %ld
\n
"
,
ret
);
ok
(
!
ret
,
"failed %ld
\n
"
,
ret
);
todo_wine
ok
(
rec
!=
NULL
,
"record not set
\n
"
);
ok
(
rec
!=
NULL
,
"record not set
\n
"
);
if
(
!
rec
)
goto
next
;
ok
(
!
strcmp
(
rec
->
pName
,
"_ldap._tcp.dc._msdcs.winehq.org"
),
"wrong name %s
\n
"
,
rec
->
pName
);
ok
(
!
strcmp
(
rec
->
pName
,
"_ldap._tcp.dc._msdcs.winehq.org"
),
"wrong name %s
\n
"
,
rec
->
pName
);
ok
(
rec
->
Flags
.
S
.
Section
==
DnsSectionAnswer
,
"wrong section %u
\n
"
,
rec
->
Flags
.
S
.
Section
);
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
->
Flags
.
S
.
CharSet
==
DnsCharSetUtf8
,
"wrong charset %u
\n
"
,
rec
->
Flags
.
S
.
CharSet
);
...
@@ -240,7 +237,6 @@ static void test_DnsExtractRecordsFromMessage(void)
...
@@ -240,7 +237,6 @@ static void test_DnsExtractRecordsFromMessage(void)
ok
(
!
rec
->
pNext
,
"next record %p
\n
"
,
rec
->
pNext
);
ok
(
!
rec
->
pNext
,
"next record %p
\n
"
,
rec
->
pNext
);
DnsRecordListFree
(
(
DNS_RECORD
*
)
rec
,
DnsFreeRecordList
);
DnsRecordListFree
(
(
DNS_RECORD
*
)
rec
,
DnsFreeRecordList
);
next:
rec
=
(
void
*
)
0xdeadbeef
;
rec
=
(
void
*
)
0xdeadbeef
;
ret
=
DnsExtractRecordsFromMessage_UTF8
(
(
DNS_MESSAGE_BUFFER
*
)
msg_question_srv
,
sizeof
(
msg_question_srv
),
&
rec
);
ret
=
DnsExtractRecordsFromMessage_UTF8
(
(
DNS_MESSAGE_BUFFER
*
)
msg_question_srv
,
sizeof
(
msg_question_srv
),
&
rec
);
ok
(
!
ret
,
"failed %ld
\n
"
,
ret
);
ok
(
!
ret
,
"failed %ld
\n
"
,
ret
);
...
@@ -248,11 +244,8 @@ next:
...
@@ -248,11 +244,8 @@ next:
rec
=
NULL
;
rec
=
NULL
;
ret
=
DnsExtractRecordsFromMessage_UTF8
(
(
DNS_MESSAGE_BUFFER
*
)
msg_answer_srv
,
sizeof
(
msg_answer_srv
),
&
rec
);
ret
=
DnsExtractRecordsFromMessage_UTF8
(
(
DNS_MESSAGE_BUFFER
*
)
msg_answer_srv
,
sizeof
(
msg_answer_srv
),
&
rec
);
todo_wine
ok
(
!
ret
,
"failed %ld
\n
"
,
ret
);
ok
(
!
ret
,
"failed %ld
\n
"
,
ret
);
todo_wine
ok
(
rec
!=
NULL
,
"record not set
\n
"
);
ok
(
rec
!=
NULL
,
"record not set
\n
"
);
if
(
!
rec
)
goto
next2
;
ok
(
!
strcmp
(
rec
->
pName
,
"_ldap._tcp.dc._msdcs.winehq.org"
),
"wrong name %s
\n
"
,
rec
->
pName
);
ok
(
!
strcmp
(
rec
->
pName
,
"_ldap._tcp.dc._msdcs.winehq.org"
),
"wrong name %s
\n
"
,
rec
->
pName
);
ok
(
rec
->
Flags
.
S
.
Section
==
DnsSectionAnswer
,
"wrong section %u
\n
"
,
rec
->
Flags
.
S
.
Section
);
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
->
Flags
.
S
.
CharSet
==
DnsCharSetUtf8
,
"wrong charset %u
\n
"
,
rec
->
Flags
.
S
.
CharSet
);
...
@@ -264,7 +257,6 @@ next:
...
@@ -264,7 +257,6 @@ next:
ok
(
!
rec
->
pNext
,
"next record %p
\n
"
,
rec
->
pNext
);
ok
(
!
rec
->
pNext
,
"next record %p
\n
"
,
rec
->
pNext
);
DnsRecordListFree
(
(
DNS_RECORD
*
)
rec
,
DnsFreeRecordList
);
DnsRecordListFree
(
(
DNS_RECORD
*
)
rec
,
DnsFreeRecordList
);
next2:
ret
=
DnsExtractRecordsFromMessage_UTF8
(
(
DNS_MESSAGE_BUFFER
*
)
msg_empty
,
sizeof
(
msg_empty
)
-
1
,
&
rec
);
ret
=
DnsExtractRecordsFromMessage_UTF8
(
(
DNS_MESSAGE_BUFFER
*
)
msg_empty
,
sizeof
(
msg_empty
)
-
1
,
&
rec
);
ok
(
ret
==
ERROR_INVALID_PARAMETER
||
broken
(
ret
==
DNS_ERROR_BAD_PACKET
)
/* win7 */
,
ok
(
ret
==
ERROR_INVALID_PARAMETER
||
broken
(
ret
==
DNS_ERROR_BAD_PACKET
)
/* win7 */
,
"failed %ld
\n
"
,
ret
);
"failed %ld
\n
"
,
ret
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment