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
2ebee181
Commit
2ebee181
authored
Dec 07, 2007
by
Rob Shearman
Committed by
Alexandre Julliard
Dec 07, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Improve PointerFree to not free buffer memory.
parent
9de1b6a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
20 deletions
+7
-20
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+5
-20
ndr_marshall.c
dlls/rpcrt4/tests/ndr_marshall.c
+2
-0
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
2ebee181
...
...
@@ -1187,28 +1187,13 @@ static void PointerFree(PMIDL_STUB_MESSAGE pStubMsg,
m
=
NdrFreer
[
*
desc
&
NDR_TABLE_MASK
];
if
(
m
)
m
(
pStubMsg
,
Pointer
,
desc
);
/* hmm... is this sensible?
* perhaps we should check if the memory comes from NdrAllocate,
/* we should check if the memory comes from NdrAllocate,
* and deallocate only if so - checking if the pointer is between
* BufferStart and BufferEnd
is probably no good
since the buffer
* BufferStart and BufferEnd
will not always work
since the buffer
* may be reallocated when the server wants to marshal the reply */
switch
(
*
desc
)
{
case
RPC_FC_BOGUS_STRUCT
:
case
RPC_FC_BOGUS_ARRAY
:
case
RPC_FC_USER_MARSHAL
:
case
RPC_FC_CARRAY
:
case
RPC_FC_CVARRAY
:
break
;
default:
FIXME
(
"unhandled data type=%02x
\n
"
,
*
desc
);
break
;
case
RPC_FC_C_CSTRING
:
case
RPC_FC_C_WSTRING
:
if
(
pStubMsg
->
ReuseBuffer
)
goto
notfree
;
break
;
case
RPC_FC_IP
:
goto
notfree
;
}
if
(
Pointer
>=
(
unsigned
char
*
)
pStubMsg
->
RpcMsg
->
Buffer
||
Pointer
<=
(
unsigned
char
*
)
pStubMsg
->
RpcMsg
->
Buffer
+
pStubMsg
->
BufferLength
)
goto
notfree
;
if
(
attr
&
RPC_FC_P_ONSTACK
)
{
TRACE
(
"not freeing stack ptr %p
\n
"
,
Pointer
);
...
...
dlls/rpcrt4/tests/ndr_marshall.c
View file @
2ebee181
...
...
@@ -1167,7 +1167,9 @@ todo_wine {
my_free_called
=
0
;
StubMsg
.
Buffer
=
StubMsg
.
BufferStart
;
NdrPointerFree
(
&
StubMsg
,
mem
,
fmtstr_conf_str
);
todo_wine
{
ok
(
my_free_called
==
1
,
"free called %d
\n
"
,
my_free_called
);
}
/* Server */
my_alloc_called
=
0
;
...
...
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