On Fri, 13 Jan 2017 06:52:17 -0500 (EST)
Frediano Ziglio <fzig...@redhat.com> wrote:

> >      case VD_AGENT_FILE_XFER_STATUS:
> >      case VD_AGENT_FILE_XFER_DATA:
> > +        if (message_header->size <
> > sizeof(VDAgentFileXferStartMessage))
> > +            goto size_error;
> > +        *id = GUINT32_FROM_LE(*id);
> > +        id++; /* size/status */
> > +        switch (message_header->type) {
> > +        case VD_AGENT_FILE_XFER_DATA:
> > +           if (message_header->size <
> > sizeof(VDAgentFileXferDataMessage))
> > +               goto size_error;
> > +           *((uint64_t *)id) = le64toh(*((uint64_t *)id)); /* size
> > */  
> 
> Why not GUINT64_FROM_LE ?

Missed the 64bit functions when changing to glib macros.

> There could be portability issues if id is not 64-bit aligned here.
> Would be better to use VDAgentFileXferDataMessage structure which
> has the right attributes to support misalignment.

yes, that might be better option.

Thanks

Michal
_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to