1 |
commit: a5d6ac97e6f58d8ce46dd78620b9df077b2a7507 |
2 |
Author: Rolf Eike Beer <eike <AT> sf-mail <DOT> de> |
3 |
AuthorDate: Mon Mar 19 17:16:05 2018 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 21 22:12:49 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5d6ac97 |
7 |
|
8 |
net-libs/libsoup-2.58.2: fix unaligned accesses |
9 |
|
10 |
Bug: https://bugs.gentoo.org/630516 |
11 |
Closes: https://github.com/gentoo/gentoo/pull/7511 |
12 |
|
13 |
.../files/libsoup-2.58.2-sparc-unaligned.patch | 28 ++++++++++++++++++++++ |
14 |
net-libs/libsoup/libsoup-2.58.2.ebuild | 5 ++++ |
15 |
2 files changed, 33 insertions(+) |
16 |
|
17 |
diff --git a/net-libs/libsoup/files/libsoup-2.58.2-sparc-unaligned.patch b/net-libs/libsoup/files/libsoup-2.58.2-sparc-unaligned.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..d09d52c292a |
20 |
--- /dev/null |
21 |
+++ b/net-libs/libsoup/files/libsoup-2.58.2-sparc-unaligned.patch |
22 |
@@ -0,0 +1,28 @@ |
23 |
+From c2aaac0083f58d285b8feb24f13fe347d7f726fe Mon Sep 17 00:00:00 2001 |
24 |
+From: Rolf Eike Beer <eike@×××××××.de> |
25 |
+Date: Sat, 17 Mar 2018 10:28:00 +0000 |
26 |
+Subject: [PATCH] WebSockets: Avoid unaligned memory access |
27 |
+ |
28 |
+This is causing test failures in SPARC architectures. |
29 |
+ |
30 |
+https://bugzilla.gnome.org/show_bug.cgi?id=794421 |
31 |
+--- |
32 |
+ libsoup/soup-websocket-connection.c | 3 ++- |
33 |
+ 1 file changed, 2 insertions(+), 1 deletion(-) |
34 |
+ |
35 |
+diff --git a/libsoup/soup-websocket-connection.c b/libsoup/soup-websocket-connection.c |
36 |
+index 0258a22c..35eee6a6 100644 |
37 |
+--- a/libsoup/soup-websocket-connection.c |
38 |
++++ b/libsoup/soup-websocket-connection.c |
39 |
+@@ -401,9 +401,10 @@ send_message (SoupWebsocketConnection *self, |
40 |
+ * probably a client somewhere that's not expecting it. |
41 |
+ */ |
42 |
+ if (self->pv->connection_type == SOUP_WEBSOCKET_CONNECTION_CLIENT) { |
43 |
++ guint32 rnd = g_random_int (); |
44 |
+ outer[1] |= 0x80; |
45 |
+ mask = outer + bytes->len; |
46 |
+- * ((guint32 *)mask) = g_random_int (); |
47 |
++ memcpy (mask, &rnd, sizeof (rnd)); |
48 |
+ bytes->len += 4; |
49 |
+ } |
50 |
+ |
51 |
|
52 |
diff --git a/net-libs/libsoup/libsoup-2.58.2.ebuild b/net-libs/libsoup/libsoup-2.58.2.ebuild |
53 |
index 194a65bc08c..2f60a0a4290 100644 |
54 |
--- a/net-libs/libsoup/libsoup-2.58.2.ebuild |
55 |
+++ b/net-libs/libsoup/libsoup-2.58.2.ebuild |
56 |
@@ -44,6 +44,11 @@ DEPEND="${RDEPEND} |
57 |
# net-misc/curl |
58 |
# net-libs/glib-networking[ssl])" |
59 |
|
60 |
+PATCHES=( |
61 |
+ # https://bugs.gentoo.org/630516 |
62 |
+ "${FILESDIR}/${PN}-2.58.2-sparc-unaligned.patch" |
63 |
+) |
64 |
+ |
65 |
src_prepare() { |
66 |
if ! use test; then |
67 |
# don't waste time building tests (bug #226271) |