[PATCH] rpcrt4: wait_async_request: return error if we received an error

Jacek Caban jacek at codeweavers.com
Mon Oct 1 03:23:12 CDT 2012


Hi Marcus,

On 09/29/12 11:44, Marcus Meissner wrote:
> Hi,
>
> Various coverity issues complain about user-after-free scenarios,
> all involving this code path.
>
> I strongly think if call_ret signals error, we also need to return
> an error condition to avoid the callers from proceeding as if nothing
> happened.

Agreed, thanks for catching it.

> Ciao, Marcus
> ---
>  dlls/rpcrt4/rpc_transport.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
> index 686ce68..e572b78 100644
> --- a/dlls/rpcrt4/rpc_transport.c
> +++ b/dlls/rpcrt4/rpc_transport.c
> @@ -1882,7 +1882,7 @@ static RPC_STATUS wait_async_request(RpcHttpAsyncData *async_data, BOOL call_ret
>  
>      if(call_ret) {
>          RpcHttpAsyncData_Release(async_data);
> -        return RPC_S_OK;
> +        return call_ret; /* The Http* status codes map into the RPC_S namespace */

Not really, Http* APIs return BOOL and GetLastError() call is needed to
get error code. AFAIR, when I tested this code, most HTTP-related errors
were translated to RPC_S_SERVER_UNAVAILABLE by rpcrt4. That may be a
better choice here as well.

Jacek



More information about the wine-devel mailing list