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
613ee6d0
Commit
613ee6d0
authored
Jun 10, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
Jun 12, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Check that strings are null-terminated on unmarshaling of conformant-varying structs.
parent
a946eb42
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+22
-0
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
613ee6d0
...
...
@@ -3202,6 +3202,28 @@ unsigned char * WINAPI NdrConformantVaryingStructUnmarshall(PMIDL_STUB_MESSAGE
pCVArrayFormat
=
ReadVariance
(
pStubMsg
,
pCVArrayFormat
);
bufsize
=
safe_multiply
(
esize
,
pStubMsg
->
ActualCount
);
if
((
cvarray_type
==
RPC_FC_C_CSTRING
)
||
(
cvarray_type
==
RPC_FC_C_WSTRING
))
{
ULONG
i
;
/* strings must always have null terminating bytes */
if
(
bufsize
<
esize
)
{
ERR
(
"invalid string length of %ld
\n
"
,
pStubMsg
->
ActualCount
);
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
NULL
;
}
for
(
i
=
bufsize
-
esize
;
i
<
bufsize
;
i
++
)
if
(
pStubMsg
->
Buffer
[
i
]
!=
0
)
{
ERR
(
"string not null-terminated at byte position %ld, data is 0x%x
\n
"
,
i
,
pStubMsg
->
Buffer
[
i
]);
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
NULL
;
}
}
/* copy the array data */
memcpy
(
*
ppMemory
+
pCVStructFormat
->
memory_size
,
pStubMsg
->
Buffer
,
bufsize
);
...
...
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