[Spice-devel] [PATCH 4/4] Remove potentially unsafe casts
Jonathon Jongsma
jjongsma at redhat.com
Tue May 24 20:05:44 UTC 2016
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
On Tue, 2016-05-24 at 15:55 +0100, Frediano Ziglio wrote:
> The id type is already uint64_t, no need to cast using some low
> level casts.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
> server/cursor-channel.c | 2 +-
> server/dcc-send.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/server/cursor-channel.c b/server/cursor-channel.c
> index b4c2d3d..ab6864c 100644
> --- a/server/cursor-channel.c
> +++ b/server/cursor-channel.c
> @@ -307,7 +307,7 @@ static inline void red_marshall_inval(RedChannelClient
> *rcc,
> SpiceMsgDisplayInvalOne inval_one;
>
> red_channel_client_init_send_data(rcc, SPICE_MSG_CURSOR_INVAL_ONE, NULL);
> - inval_one.id = *(uint64_t *)&cach_item->id;
> + inval_one.id = cach_item->id;
>
> spice_marshall_msg_cursor_inval_one(base_marshaller, &inval_one);
> }
> diff --git a/server/dcc-send.c b/server/dcc-send.c
> index d766e77..5171f9a 100644
> --- a/server/dcc-send.c
> +++ b/server/dcc-send.c
> @@ -1777,7 +1777,7 @@ static inline void
> marshall_inval_palette(RedChannelClient *rcc,
> SpiceMsgDisplayInvalOne inval_one;
>
> red_channel_client_init_send_data(rcc, SPICE_MSG_DISPLAY_INVAL_PALETTE,
> NULL);
> - inval_one.id = *(uint64_t *)&cache_item->id;
> + inval_one.id = cache_item->id;
>
> spice_marshall_msg_display_inval_palette(base_marshaller, &inval_one);
>
More information about the Spice-devel
mailing list