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
556b3981
Commit
556b3981
authored
Oct 10, 2022
by
David Kahurani
Committed by
Alexandre Julliard
Oct 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xmllite/writer: Null terminate duplicated strings.
Strings are not being "partially duplicated", but duplicated with explicit length. Signed-off-by:
David Kahurani
<
k.kahurani@gmail.com
>
parent
e3f00bf7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
writer.c
dlls/xmllite/writer.c
+6
-4
No files found.
dlls/xmllite/writer.c
View file @
556b3981
...
...
@@ -250,7 +250,6 @@ static struct element *pop_element(xmlwriter *writer)
static
WCHAR
*
writer_strndupW
(
const
xmlwriter
*
writer
,
const
WCHAR
*
str
,
int
len
)
{
size_t
size
;
WCHAR
*
ret
;
if
(
!
str
)
...
...
@@ -259,9 +258,12 @@ static WCHAR *writer_strndupW(const xmlwriter *writer, const WCHAR *str, int len
if
(
len
==
-
1
)
len
=
lstrlenW
(
str
);
size
=
(
len
+
1
)
*
sizeof
(
WCHAR
);
ret
=
writer_alloc
(
writer
,
size
);
if
(
ret
)
memcpy
(
ret
,
str
,
size
);
ret
=
writer_alloc
(
writer
,
(
len
+
1
)
*
sizeof
(
WCHAR
));
if
(
ret
)
{
memcpy
(
ret
,
str
,
len
*
sizeof
(
WCHAR
));
ret
[
len
]
=
0
;
}
return
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