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
5fce2d88
Commit
5fce2d88
authored
Feb 27, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Feb 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Don't crash in RpcStringBindingParseA/W if Endpoint or Options is NULL.
parent
376be08a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
18 deletions
+32
-18
rpc_binding.c
dlls/rpcrt4/rpc_binding.c
+32
-18
No files found.
dlls/rpcrt4/rpc_binding.c
View file @
5fce2d88
...
@@ -468,6 +468,7 @@ RPC_STATUS WINAPI RpcStringBindingParseA( RPC_CSTR StringBinding, RPC_CSTR *ObjU
...
@@ -468,6 +468,7 @@ RPC_STATUS WINAPI RpcStringBindingParseA( RPC_CSTR StringBinding, RPC_CSTR *ObjU
{
{
CHAR
*
data
,
*
next
;
CHAR
*
data
,
*
next
;
static
const
char
ep_opt
[]
=
"endpoint="
;
static
const
char
ep_opt
[]
=
"endpoint="
;
BOOL
endpoint_already_found
=
FALSE
;
TRACE
(
"(%s,%p,%p,%p,%p,%p)
\n
"
,
debugstr_a
((
char
*
)
StringBinding
),
TRACE
(
"(%s,%p,%p,%p,%p,%p)
\n
"
,
debugstr_a
((
char
*
)
StringBinding
),
ObjUuid
,
Protseq
,
NetworkAddr
,
Endpoint
,
Options
);
ObjUuid
,
Protseq
,
NetworkAddr
,
Endpoint
,
Options
);
...
@@ -513,22 +514,28 @@ RPC_STATUS WINAPI RpcStringBindingParseA( RPC_CSTR StringBinding, RPC_CSTR *ObjU
...
@@ -513,22 +514,28 @@ RPC_STATUS WINAPI RpcStringBindingParseA( RPC_CSTR StringBinding, RPC_CSTR *ObjU
next
=
strchr
(
opt
,
'='
);
next
=
strchr
(
opt
,
'='
);
if
(
!
next
)
{
if
(
!
next
)
{
/* not an option, must be an endpoint */
/* not an option, must be an endpoint */
if
(
*
Endpoint
)
goto
fail
;
if
(
endpoint_already_found
)
goto
fail
;
*
Endpoint
=
(
unsigned
char
*
)
opt
;
if
(
Endpoint
)
*
Endpoint
=
(
unsigned
char
*
)
opt
;
else
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
endpoint_already_found
=
TRUE
;
}
else
{
}
else
{
if
(
strncmp
(
opt
,
ep_opt
,
strlen
(
ep_opt
))
==
0
)
{
if
(
strncmp
(
opt
,
ep_opt
,
strlen
(
ep_opt
))
==
0
)
{
/* endpoint option */
/* endpoint option */
if
(
*
Endpoint
)
goto
fail
;
if
(
endpoint_already_found
)
goto
fail
;
*
Endpoint
=
(
unsigned
char
*
)
RPCRT4_strdupA
(
next
+
1
);
if
(
Endpoint
)
*
Endpoint
=
(
unsigned
char
*
)
RPCRT4_strdupA
(
next
+
1
);
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
endpoint_already_found
=
TRUE
;
}
else
{
}
else
{
/* network option */
/* network option */
if
(
*
Options
)
{
if
(
Options
)
{
/* FIXME: this is kind of inefficient */
if
(
*
Options
)
{
*
Options
=
(
unsigned
char
*
)
RPCRT4_strconcatA
(
(
char
*
)
*
Options
,
opt
);
/* FIXME: this is kind of inefficient */
*
Options
=
(
unsigned
char
*
)
RPCRT4_strconcatA
(
(
char
*
)
*
Options
,
opt
);
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
}
else
*
Options
=
(
unsigned
char
*
)
opt
;
}
else
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
}
else
*
Options
=
(
unsigned
char
*
)
opt
;
}
}
}
}
}
}
...
@@ -559,6 +566,7 @@ RPC_STATUS WINAPI RpcStringBindingParseW( RPC_WSTR StringBinding, RPC_WSTR *ObjU
...
@@ -559,6 +566,7 @@ RPC_STATUS WINAPI RpcStringBindingParseW( RPC_WSTR StringBinding, RPC_WSTR *ObjU
{
{
WCHAR
*
data
,
*
next
;
WCHAR
*
data
,
*
next
;
static
const
WCHAR
ep_opt
[]
=
{
'e'
,
'n'
,
'd'
,
'p'
,
'o'
,
'i'
,
'n'
,
't'
,
'='
,
0
};
static
const
WCHAR
ep_opt
[]
=
{
'e'
,
'n'
,
'd'
,
'p'
,
'o'
,
'i'
,
'n'
,
't'
,
'='
,
0
};
BOOL
endpoint_already_found
=
FALSE
;
TRACE
(
"(%s,%p,%p,%p,%p,%p)
\n
"
,
debugstr_w
(
StringBinding
),
TRACE
(
"(%s,%p,%p,%p,%p,%p)
\n
"
,
debugstr_w
(
StringBinding
),
ObjUuid
,
Protseq
,
NetworkAddr
,
Endpoint
,
Options
);
ObjUuid
,
Protseq
,
NetworkAddr
,
Endpoint
,
Options
);
...
@@ -604,22 +612,28 @@ RPC_STATUS WINAPI RpcStringBindingParseW( RPC_WSTR StringBinding, RPC_WSTR *ObjU
...
@@ -604,22 +612,28 @@ RPC_STATUS WINAPI RpcStringBindingParseW( RPC_WSTR StringBinding, RPC_WSTR *ObjU
next
=
strchrW
(
opt
,
'='
);
next
=
strchrW
(
opt
,
'='
);
if
(
!
next
)
{
if
(
!
next
)
{
/* not an option, must be an endpoint */
/* not an option, must be an endpoint */
if
(
*
Endpoint
)
goto
fail
;
if
(
endpoint_already_found
)
goto
fail
;
*
Endpoint
=
opt
;
if
(
Endpoint
)
*
Endpoint
=
opt
;
else
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
endpoint_already_found
=
TRUE
;
}
else
{
}
else
{
if
(
strncmpW
(
opt
,
ep_opt
,
strlenW
(
ep_opt
))
==
0
)
{
if
(
strncmpW
(
opt
,
ep_opt
,
strlenW
(
ep_opt
))
==
0
)
{
/* endpoint option */
/* endpoint option */
if
(
*
Endpoint
)
goto
fail
;
if
(
endpoint_already_found
)
goto
fail
;
*
Endpoint
=
RPCRT4_strdupW
(
next
+
1
);
if
(
Endpoint
)
*
Endpoint
=
RPCRT4_strdupW
(
next
+
1
);
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
endpoint_already_found
=
TRUE
;
}
else
{
}
else
{
/* network option */
/* network option */
if
(
*
Options
)
{
if
(
Options
)
{
/* FIXME: this is kind of inefficient */
if
(
*
Options
)
{
*
Options
=
RPCRT4_strconcatW
(
*
Options
,
opt
);
/* FIXME: this is kind of inefficient */
*
Options
=
RPCRT4_strconcatW
(
*
Options
,
opt
);
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
}
else
*
Options
=
opt
;
}
else
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
HeapFree
(
GetProcessHeap
(),
0
,
opt
);
}
else
*
Options
=
opt
;
}
}
}
}
}
}
...
...
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