mirror of
https://gitlab.winehq.org/wine/wine.git
synced 2024-11-19 17:06:04 -07:00
server: Avoid memcpy with null pointer (Clang).
This commit is contained in:
parent
c8e069470f
commit
5b1b85960e
2 changed files with 14 additions and 15 deletions
|
@ -468,12 +468,15 @@ DECL_HANDLER(get_clipboard_data)
|
|||
|
||||
if (req->cached && req->seqno == format->seqno) goto done; /* client-side cache still valid */
|
||||
|
||||
if (format->data)
|
||||
{
|
||||
if (format->size > get_reply_max_size())
|
||||
{
|
||||
set_error( STATUS_BUFFER_OVERFLOW );
|
||||
return;
|
||||
}
|
||||
set_reply_data( format->data, format->size );
|
||||
}
|
||||
|
||||
done:
|
||||
if (!req->render) clipboard->rendering--;
|
||||
|
|
|
@ -1549,25 +1549,21 @@ DECL_HANDLER(get_token_default_dacl)
|
|||
{
|
||||
struct token *token;
|
||||
|
||||
reply->acl_len = 0;
|
||||
if (!(token = (struct token *)get_handle_obj( current->process, req->handle,
|
||||
TOKEN_QUERY, &token_ops )))
|
||||
return;
|
||||
|
||||
if ((token = (struct token *)get_handle_obj( current->process, req->handle,
|
||||
TOKEN_QUERY,
|
||||
&token_ops )))
|
||||
{
|
||||
if (token->default_dacl)
|
||||
{
|
||||
reply->acl_len = token->default_dacl->size;
|
||||
|
||||
if (reply->acl_len <= get_reply_max_size())
|
||||
{
|
||||
struct acl *acl_reply = set_reply_data_size( reply->acl_len );
|
||||
if (acl_reply)
|
||||
memcpy( acl_reply, token->default_dacl, reply->acl_len );
|
||||
if (acl_reply) memcpy( acl_reply, token->default_dacl, reply->acl_len );
|
||||
}
|
||||
else set_error( STATUS_BUFFER_TOO_SMALL );
|
||||
|
||||
release_object( token );
|
||||
}
|
||||
release_object( token );
|
||||
}
|
||||
|
||||
DECL_HANDLER(set_token_default_dacl)
|
||||
|
|
Loading…
Reference in a new issue