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
0529e5b4
Commit
0529e5b4
authored
Mar 01, 2019
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 01, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dnsapi: Fix data length returned for records that contain Unicode strings.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
ecaeaa97
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
record.c
dlls/dnsapi/record.c
+31
-0
No files found.
dlls/dnsapi/record.c
View file @
0529e5b4
...
...
@@ -21,6 +21,7 @@
#include "config.h"
#include "wine/port.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include <stdarg.h>
#include <stdio.h>
...
...
@@ -480,6 +481,11 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
heap_free
(
dst
->
Data
.
MINFO
.
pNameMailbox
);
goto
error
;
}
dst
->
wDataLength
=
sizeof
(
dst
->
Data
.
MINFO
);
if
(
out
==
DnsCharSetUnicode
)
dst
->
wDataLength
+=
(
strlenW
(
dst
->
Data
.
MINFO
.
pNameMailbox
)
+
1
)
*
sizeof
(
WCHAR
)
+
(
strlenW
(
dst
->
Data
.
MINFO
.
pNameErrorsMailbox
)
+
1
)
*
sizeof
(
WCHAR
);
break
;
}
case
DNS_TYPE_AFSDB
:
...
...
@@ -489,6 +495,10 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst
->
Data
.
MX
.
pNameExchange
=
dns_strcpyX
(
src
->
Data
.
MX
.
pNameExchange
,
in
,
out
);
if
(
!
dst
->
Data
.
MX
.
pNameExchange
)
goto
error
;
dst
->
wDataLength
=
sizeof
(
dst
->
Data
.
MX
);
if
(
out
==
DnsCharSetUnicode
)
dst
->
wDataLength
+=
(
strlenW
(
dst
->
Data
.
MX
.
pNameExchange
)
+
1
)
*
sizeof
(
WCHAR
);
break
;
}
case
DNS_TYPE_NXT
:
...
...
@@ -496,6 +506,10 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst
->
Data
.
NXT
.
pNameNext
=
dns_strcpyX
(
src
->
Data
.
NXT
.
pNameNext
,
in
,
out
);
if
(
!
dst
->
Data
.
NXT
.
pNameNext
)
goto
error
;
dst
->
wDataLength
=
sizeof
(
dst
->
Data
.
NXT
);
if
(
out
==
DnsCharSetUnicode
)
dst
->
wDataLength
+=
(
strlenW
(
dst
->
Data
.
NXT
.
pNameNext
)
+
1
)
*
sizeof
(
WCHAR
);
break
;
}
case
DNS_TYPE_CNAME
:
...
...
@@ -510,6 +524,10 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst
->
Data
.
PTR
.
pNameHost
=
dns_strcpyX
(
src
->
Data
.
PTR
.
pNameHost
,
in
,
out
);
if
(
!
dst
->
Data
.
PTR
.
pNameHost
)
goto
error
;
dst
->
wDataLength
=
sizeof
(
dst
->
Data
.
PTR
);
if
(
out
==
DnsCharSetUnicode
)
dst
->
wDataLength
+=
(
strlenW
(
dst
->
Data
.
PTR
.
pNameHost
)
+
1
)
*
sizeof
(
WCHAR
);
break
;
}
case
DNS_TYPE_SIG
:
...
...
@@ -517,6 +535,10 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst
->
Data
.
SIG
.
pNameSigner
=
dns_strcpyX
(
src
->
Data
.
SIG
.
pNameSigner
,
in
,
out
);
if
(
!
dst
->
Data
.
SIG
.
pNameSigner
)
goto
error
;
dst
->
wDataLength
=
sizeof
(
dst
->
Data
.
SIG
);
if
(
out
==
DnsCharSetUnicode
)
dst
->
wDataLength
+=
(
strlenW
(
dst
->
Data
.
SIG
.
pNameSigner
)
+
1
)
*
sizeof
(
WCHAR
);
break
;
}
case
DNS_TYPE_SOA
:
...
...
@@ -532,6 +554,11 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
heap_free
(
dst
->
Data
.
SOA
.
pNamePrimaryServer
);
goto
error
;
}
dst
->
wDataLength
=
sizeof
(
dst
->
Data
.
SOA
);
if
(
out
==
DnsCharSetUnicode
)
dst
->
wDataLength
+=
(
strlenW
(
dst
->
Data
.
SOA
.
pNamePrimaryServer
)
+
1
)
*
sizeof
(
WCHAR
)
+
(
strlenW
(
dst
->
Data
.
SOA
.
pNameAdministrator
)
+
1
)
*
sizeof
(
WCHAR
);
break
;
}
case
DNS_TYPE_SRV
:
...
...
@@ -539,6 +566,10 @@ PDNS_RECORD WINAPI DnsRecordCopyEx( PDNS_RECORD src, DNS_CHARSET in, DNS_CHARSET
dst
->
Data
.
SRV
.
pNameTarget
=
dns_strcpyX
(
src
->
Data
.
SRV
.
pNameTarget
,
in
,
out
);
if
(
!
dst
->
Data
.
SRV
.
pNameTarget
)
goto
error
;
dst
->
wDataLength
=
sizeof
(
dst
->
Data
.
SRV
);
if
(
out
==
DnsCharSetUnicode
)
dst
->
wDataLength
+=
(
strlenW
(
dst
->
Data
.
SRV
.
pNameTarget
)
+
1
)
*
sizeof
(
WCHAR
);
break
;
}
default:
...
...
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