Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ae4de9d6
Commit
ae4de9d6
authored
Oct 14, 2009
by
Alexander Kochetkov
Committed by
Alexandre Julliard
Oct 14, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Fix null terminator in SysReAllocStringLen.
parent
b6da0725
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
10 deletions
+7
-10
oleaut.c
dlls/oleaut32/oleaut.c
+6
-9
vartype.c
dlls/oleaut32/tests/vartype.c
+1
-1
No files found.
dlls/oleaut32/oleaut.c
View file @
ae4de9d6
...
...
@@ -298,15 +298,12 @@ int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
DWORD
*
ptr
=
HeapReAlloc
(
GetProcessHeap
(),
0
,((
DWORD
*
)
*
old
)
-
1
,
newbytelen
+
sizeof
(
WCHAR
)
+
sizeof
(
DWORD
));
*
old
=
(
BSTR
)(
ptr
+
1
);
*
ptr
=
newbytelen
;
if
(
str
)
{
memmove
(
*
old
,
str
,
newbytelen
);
(
*
old
)[
len
]
=
0
;
}
else
{
/* Subtle hidden feature: The old string data is still there
* when 'in' is NULL!
* Some Microsoft program needs it.
*/
}
/* Subtle hidden feature: The old string data is still there
* when 'in' is NULL!
* Some Microsoft program needs it.
*/
if
(
str
)
memmove
(
*
old
,
str
,
newbytelen
);
(
*
old
)[
len
]
=
0
;
}
else
{
/*
* Allocate the new string
...
...
dlls/oleaut32/tests/vartype.c
View file @
ae4de9d6
...
...
@@ -5422,7 +5422,7 @@ static void test_SysReAllocStringLen(void)
if
(
str
)
{
ok
(
str
==
oldstr
,
"Expected reuse of the old string memory
\n
"
);
todo_wine
ok
(
str
[
STRING_SIZE
]
==
0
,
ok
(
str
[
STRING_SIZE
]
==
0
,
"Expected null terminator, got 0x%04X
\n
"
,
str
[
STRING_SIZE
]);
SysFreeString
(
str
);
}
...
...
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