1 |
commit: ad699292711447f8983a44382c61c0dd00967145 |
2 |
Author: Petr Vaněk <arkamar <AT> atlas <DOT> cz> |
3 |
AuthorDate: Fri Jul 29 12:42:10 2022 +0000 |
4 |
Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 18 07:06:18 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad699292 |
7 |
|
8 |
net-im/bitlbee: fix strict-aliasing issue in bundled library |
9 |
|
10 |
The patch is based on fixes from upstream. LICENSE is extended with |
11 |
BSD-2, the license of bundled library. |
12 |
|
13 |
Upstream-PR: https://github.com/bitlbee/bitlbee/pull/162 |
14 |
Closes: https://bugs.gentoo.org/861371 |
15 |
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz> |
16 |
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org> |
17 |
|
18 |
net-im/bitlbee/bitlbee-3.6-r1.ebuild | 3 ++- |
19 |
.../files/bitlbee-3.6-strict-aliasing.patch | 31 ++++++++++++++++++++++ |
20 |
2 files changed, 33 insertions(+), 1 deletion(-) |
21 |
|
22 |
diff --git a/net-im/bitlbee/bitlbee-3.6-r1.ebuild b/net-im/bitlbee/bitlbee-3.6-r1.ebuild |
23 |
index c54da3fb2392..73fbb3f13b6c 100644 |
24 |
--- a/net-im/bitlbee/bitlbee-3.6-r1.ebuild |
25 |
+++ b/net-im/bitlbee/bitlbee-3.6-r1.ebuild |
26 |
@@ -18,7 +18,7 @@ fi |
27 |
DESCRIPTION="irc to IM gateway that support multiple IM protocols" |
28 |
HOMEPAGE="https://www.bitlbee.org/" |
29 |
|
30 |
-LICENSE="GPL-2" |
31 |
+LICENSE="GPL-2 BSD-2" |
32 |
SLOT="0" |
33 |
IUSE_PROTOCOLS="msn oscar purple twitter +xmpp" |
34 |
IUSE="debug +gnutls ipv6 libevent nss otr +plugins selinux test xinetd |
35 |
@@ -65,6 +65,7 @@ PATCHES=( |
36 |
"${FILESDIR}"/${PN}-3.5-libcheck.patch |
37 |
"${FILESDIR}"/${PN}-3.5-libevent.patch |
38 |
"${FILESDIR}"/${P}-disabled-plugins-use.patch |
39 |
+ "${FILESDIR}"/${P}-strict-aliasing.patch |
40 |
) |
41 |
|
42 |
src_configure() { |
43 |
|
44 |
diff --git a/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch b/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch |
45 |
new file mode 100644 |
46 |
index 000000000000..30ecff9747ee |
47 |
--- /dev/null |
48 |
+++ b/net-im/bitlbee/files/bitlbee-3.6-strict-aliasing.patch |
49 |
@@ -0,0 +1,31 @@ |
50 |
+Based on upstream [1] commits: |
51 |
+- 161dff8321df ("Fix error type-punned pointer warning") |
52 |
+- d7b67db02aaa ("Fix error type-punned pointer warning") |
53 |
+ |
54 |
+[1] https://github.com/json-parser/json-parser |
55 |
+ |
56 |
+Upstream-PR: https://github.com/bitlbee/bitlbee/pull/162 |
57 |
+ |
58 |
+diff --git a/lib/json.c b/lib/json.c |
59 |
+index 24288f94..2150cbaf 100644 |
60 |
+--- a/lib/json.c |
61 |
++++ b/lib/json.c |
62 |
+@@ -139,7 +139,7 @@ static int new_value |
63 |
+ return 0; |
64 |
+ } |
65 |
+ |
66 |
+- value->_reserved.object_mem = (*(char **) &value->u.object.values) + values_size; |
67 |
++ value->_reserved.object_mem = (void *) (((char *) value->u.object.values) + values_size); |
68 |
+ |
69 |
+ value->u.object.length = 0; |
70 |
+ break; |
71 |
+@@ -406,7 +406,8 @@ json_value * json_parse_ex(json_settings * settings, |
72 |
+ case json_object: |
73 |
+ |
74 |
+ if (state.first_pass) { |
75 |
+- (*(json_char **) &top->u.object.values) += string_length + 1; |
76 |
++ json_char **chars = (json_char **) &top->u.object.values; |
77 |
++ chars[0] += string_length + 1; |
78 |
+ } else { |
79 |
+ top->u.object.values [top->u.object.length].name |
80 |
+ = (json_char *) top->_reserved.object_mem; |