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
cec6092a
Commit
cec6092a
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: Raise an exception during unmarshaling if a conformant string isn't null-terminated.
parent
6e95bfe8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+17
-1
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
cec6092a
...
...
@@ -667,7 +667,7 @@ unsigned long WINAPI NdrConformantStringMemorySize( PMIDL_STUB_MESSAGE pStubMsg,
unsigned
char
*
WINAPI
NdrConformantStringUnmarshall
(
PMIDL_STUB_MESSAGE
pStubMsg
,
unsigned
char
**
ppMemory
,
PFORMAT_STRING
pFormat
,
unsigned
char
fMustAlloc
)
{
unsigned
long
size
,
esize
;
ULONG
size
,
esize
,
i
;
TRACE
(
"(pStubMsg == ^%p, *pMemory == ^%p, pFormat == ^%p, fMustAlloc == %u)
\n
"
,
pStubMsg
,
*
ppMemory
,
pFormat
,
fMustAlloc
);
...
...
@@ -687,6 +687,22 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
size
=
safe_multiply
(
esize
,
pStubMsg
->
ActualCount
);
/* strings must always have null terminating bytes */
if
(
size
<
esize
)
{
ERR
(
"invalid string length of %ld
\n
"
,
pStubMsg
->
ActualCount
);
RpcRaiseException
(
RPC_S_INVALID_BOUND
);
return
NULL
;
}
for
(
i
=
size
-
esize
;
i
<
size
;
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
;
}
if
(
fMustAlloc
||
!*
ppMemory
)
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
...
...
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