Re: [PATCH] fix unaligned memory write



Hi,

Thanks for the patch. We use GNOME bugzilla to track issues, please
submit it there?

https://bugzilla.gnome.org

Claudio

On Fri, 2017-11-24 at 18:29 +0100, Rolf Eike Beer wrote:
Sparc is extremely picky about unaligned accesses. Use memcpy() to
make it 
work reliably. Compilers will usually optimize the memcpy away on 
architectures that support unaligned accesses.

See: https://bugs.gentoo.org/630516
---
--- a/libsoup/soup-websocket-connection.c     2017-11-24
17:55:58.119804106 +0100
+++ b/libsoup/soup-websocket-connection.c     2017-11-24
17:58:35.169798836 
+0100
@@ -395,9 +395,10 @@
       * probably a client somewhere that's not expecting it.
       */
      if (self->pv->connection_type ==
SOUP_WEBSOCKET_CONNECTION_CLIENT) {
+             guint32 rnd = g_random_int ();
              outer[1] |= 0x80;
              mask = outer + bytes->len;
-             * ((guint32 *)mask) = g_random_int ();
+             memcpy(mask, &rnd, sizeof(rnd));
              bytes->len += 4;
      }
 
_______________________________________________
libsoup-list mailing list
libsoup-list gnome org
https://mail.gnome.org/mailman/listinfo/libsoup-list


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]