Commit c2aaac00 authored by Rolf Eike Beer's avatar Rolf Eike Beer Committed by Claudio Saavedra
Browse files

WebSockets: Avoid unaligned memory access

This is causing test failures in SPARC architectures.

https://bugzilla.gnome.org/show_bug.cgi?id=794421
parent e1cc7120
...@@ -401,9 +401,10 @@ send_message (SoupWebsocketConnection *self, ...@@ -401,9 +401,10 @@ send_message (SoupWebsocketConnection *self,
* probably a client somewhere that's not expecting it. * probably a client somewhere that's not expecting it.
*/ */
if (self->pv->connection_type == SOUP_WEBSOCKET_CONNECTION_CLIENT) { if (self->pv->connection_type == SOUP_WEBSOCKET_CONNECTION_CLIENT) {
guint32 rnd = g_random_int ();
outer[1] |= 0x80; outer[1] |= 0x80;
mask = outer + bytes->len; mask = outer + bytes->len;
* ((guint32 *)mask) = g_random_int (); memcpy (mask, &rnd, sizeof (rnd));
bytes->len += 4; bytes->len += 4;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment