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
41da198a
Commit
41da198a
authored
Aug 17, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Aug 18, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webservices: Validate the handle in channel functions.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
c06f2d4f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
channel.c
dlls/webservices/channel.c
+4
-1
channel.c
dlls/webservices/tests/channel.c
+11
-4
No files found.
dlls/webservices/channel.c
View file @
41da198a
...
...
@@ -188,6 +188,7 @@ HRESULT WINAPI WsGetChannelProperty( WS_CHANNEL *handle, WS_CHANNEL_PROPERTY_ID
TRACE
(
"%p %u %p %u %p
\n
"
,
handle
,
id
,
buf
,
size
,
error
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
handle
)
return
E_INVALIDARG
;
return
prop_get
(
channel
->
prop
,
channel
->
prop_count
,
id
,
buf
,
size
);
}
...
...
@@ -202,6 +203,7 @@ HRESULT WINAPI WsSetChannelProperty( WS_CHANNEL *handle, WS_CHANNEL_PROPERTY_ID
TRACE
(
"%p %u %p %u
\n
"
,
handle
,
id
,
value
,
size
);
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
!
handle
)
return
E_INVALIDARG
;
return
prop_set
(
channel
->
prop
,
channel
->
prop_count
,
id
,
value
,
size
);
}
...
...
@@ -223,7 +225,7 @@ HRESULT WINAPI WsOpenChannel( WS_CHANNEL *handle, const WS_ENDPOINT_ADDRESS *end
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
ctx
)
FIXME
(
"ignoring ctx parameter
\n
"
);
if
(
!
endpoint
)
return
E_INVALIDARG
;
if
(
!
handle
||
!
endpoint
)
return
E_INVALIDARG
;
if
(
channel
->
state
!=
WS_CHANNEL_STATE_CREATED
)
return
WS_E_INVALID_OPERATION
;
return
open_channel
(
channel
,
endpoint
);
...
...
@@ -246,5 +248,6 @@ HRESULT WINAPI WsCloseChannel( WS_CHANNEL *handle, const WS_ASYNC_CONTEXT *ctx,
if
(
error
)
FIXME
(
"ignoring error parameter
\n
"
);
if
(
ctx
)
FIXME
(
"ignoring ctx parameter
\n
"
);
if
(
!
handle
)
return
E_INVALIDARG
;
return
close_channel
(
channel
);
}
dlls/webservices/tests/channel.c
View file @
41da198a
...
...
@@ -28,11 +28,11 @@ static void test_WsCreateChannel(void)
WS_CHANNEL_STATE
state
;
ULONG
size
,
value
;
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
NULL
,
NULL
)
;
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
channel
=
NULL
;
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
&
channel
,
NULL
)
;
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
&
channel
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
ok
(
channel
!=
NULL
,
"channel not set
\n
"
);
...
...
@@ -64,14 +64,14 @@ static void test_WsOpenChannel(void)
WS_CHANNEL
*
channel
;
WS_ENDPOINT_ADDRESS
addr
;
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
&
channel
,
NULL
)
;
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
&
channel
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsCloseChannel
(
channel
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
WsFreeChannel
(
channel
);
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
&
channel
,
NULL
)
;
hr
=
WsCreateChannel
(
WS_CHANNEL_TYPE_REQUEST
,
WS_HTTP_CHANNEL_BINDING
,
NULL
,
0
,
NULL
,
&
channel
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsOpenChannel
(
channel
,
NULL
,
NULL
,
NULL
);
...
...
@@ -82,6 +82,9 @@ static void test_WsOpenChannel(void)
addr
.
headers
=
NULL
;
addr
.
extensions
=
NULL
;
addr
.
identity
=
NULL
;
hr
=
WsOpenChannel
(
NULL
,
&
addr
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
hr
=
WsOpenChannel
(
channel
,
&
addr
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
...
...
@@ -93,6 +96,10 @@ static void test_WsOpenChannel(void)
hr
=
WsCloseChannel
(
channel
,
NULL
,
NULL
);
ok
(
hr
==
S_OK
,
"got %08x
\n
"
,
hr
);
hr
=
WsCloseChannel
(
NULL
,
NULL
,
NULL
);
ok
(
hr
==
E_INVALIDARG
,
"got %08x
\n
"
,
hr
);
WsFreeChannel
(
channel
);
}
...
...
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