[Spice-devel] [PATCH spice-server v3 10/12] red-stream: Handle properly endianness in SASL code

Christophe Fergeau cfergeau at redhat.com
Fri Jan 5 13:13:38 UTC 2018


On Fri, Dec 22, 2017 at 10:07:11AM +0000, Frediano Ziglio wrote:
> All SPICE protocol is little endian, there's no agreement on other
> endian and currently we support only little endian so make sure
> this will work even possibly running on a big endian machine.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-stream.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/server/red-stream.c b/server/red-stream.c
> index a0423228f..83afd2b45 100644
> --- a/server/red-stream.c
> +++ b/server/red-stream.c
> @@ -582,6 +582,7 @@ static bool red_stream_write_u8(RedStream *s, uint8_t n)
>  
>  static bool red_stream_write_u32(RedStream *s, uint32_t n)
>  {
> +    n = GUINT32_TO_LE(n);

If you do that change, I would rename the method to
red_stream_write_u32_le()

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180105/2a1826c7/attachment.sig>


More information about the Spice-devel mailing list