Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx> On Mon, Jun 18, 2018 at 10:38:53AM +0100, Frediano Ziglio wrote: > Although capabilities inside link message are handled as arrays > of 4 bytes unsigned integers we don't need capabilities to be > aligned to 4 bytes just to call g_memdup so use a pointer to > uint8_t instead. > > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx> > --- > server/reds.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/server/reds.c b/server/reds.c > index 935448d8..66a221c3 100644 > --- a/server/reds.c > +++ b/server/reds.c > @@ -1758,7 +1758,7 @@ static void > red_channel_capabilities_init_from_link_message(RedChannelCapabilities *caps, > const SpiceLinkMess *link_mess) > { > - const uint32_t *raw_caps = (uint32_t *)((uint8_t *)link_mess + link_mess->caps_offset); > + const uint8_t *raw_caps = (const uint8_t *)link_mess + link_mess->caps_offset; > > caps->num_common_caps = link_mess->num_common_caps; > caps->common_caps = NULL; > @@ -1769,7 +1769,7 @@ red_channel_capabilities_init_from_link_message(RedChannelCapabilities *caps, > caps->num_caps = link_mess->num_channel_caps; > caps->caps = NULL; > if (link_mess->num_channel_caps) { > - caps->caps = g_memdup(raw_caps + link_mess->num_common_caps, > + caps->caps = g_memdup(raw_caps + link_mess->num_common_caps * sizeof(uint32_t), > link_mess->num_channel_caps * sizeof(uint32_t)); > } > } > -- > 2.17.1 > > _______________________________________________ > Spice-devel mailing list > Spice-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/spice-devel
Attachment:
signature.asc
Description: PGP signature
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/spice-devel