Gentoo Archives: gentoo-commits

From: Akinori Hattori <hattya@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-text/chasen/files/, app-text/chasen/
Date: Mon, 22 Nov 2021 14:52:29
Message-Id: 1637592717.f79eeb6f40f8f00c9b757066c25892c1ca812732.hattya@gentoo
1 commit: f79eeb6f40f8f00c9b757066c25892c1ca812732
2 Author: Akinori Hattori <hattya <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 22 14:51:57 2021 +0000
4 Commit: Akinori Hattori <hattya <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 22 14:51:57 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f79eeb6f
7
8 app-text/chasen: fix stack use after return
9
10 Closes: https://bugs.gentoo.org/825018
11 Package-Manager: Portage-3.0.28, Repoman-3.0.3
12 Signed-off-by: Akinori Hattori <hattya <AT> gentoo.org>
13
14 app-text/chasen/chasen-2.4.5.ebuild | 2 ++
15 app-text/chasen/files/chasen-uar.patch | 44 ++++++++++++++++++++++++++++++++++
16 2 files changed, 46 insertions(+)
17
18 diff --git a/app-text/chasen/chasen-2.4.5.ebuild b/app-text/chasen/chasen-2.4.5.ebuild
19 index 48d64ea7ef9a..d7433b71a1f0 100644
20 --- a/app-text/chasen/chasen-2.4.5.ebuild
21 +++ b/app-text/chasen/chasen-2.4.5.ebuild
22 @@ -18,6 +18,8 @@ RDEPEND="virtual/libiconv"
23 DEPEND=">=dev-libs/darts-0.32"
24 PDEPEND=">=app-dicts/ipadic-2.7.0"
25
26 +PATCHES=( "${FILESDIR}"/${PN}-uar.patch )
27 +
28 src_configure() {
29 econf $(use_enable static-libs static)
30
31
32 diff --git a/app-text/chasen/files/chasen-uar.patch b/app-text/chasen/files/chasen-uar.patch
33 new file mode 100644
34 index 000000000000..631e0890f751
35 --- /dev/null
36 +++ b/app-text/chasen/files/chasen-uar.patch
37 @@ -0,0 +1,44 @@
38 +--- a/lib/print.c
39 ++++ b/lib/print.c
40 +@@ -997,20 +997,20 @@
41 + static int
42 + get_compound(mrph_data_t *data, char *headword, darts_t *da, long index)
43 + {
44 +- mrph_t mrph;
45 ++ mrph_t *mrph = data->mrph;
46 + int has_next, hw_len;
47 + char *base = da_get_lex_base(da) + index;
48 +
49 + hw_len = ((short *)base)[0];
50 + has_next = ((short *)base)[1];
51 + base += sizeof(short) * 2;
52 +- memcpy(&mrph, base, sizeof(da_lex_t));
53 +- mrph.headword = headword;
54 +- mrph.headword_len = hw_len;
55 +- mrph.is_undef = 0;
56 +- mrph.darts = da;
57 ++ memcpy(mrph, base, sizeof(da_lex_t));
58 ++ mrph->headword = headword;
59 ++ mrph->headword_len = hw_len;
60 ++ mrph->is_undef = 0;
61 ++ mrph->darts = da;
62 +
63 +- get_mrph_data(&mrph, data);
64 ++ get_mrph_data(mrph, data);
65 +
66 + return has_next;
67 + }
68 +@@ -1028,10 +1028,13 @@
69 + cha_printf_mrph(lat, path_num, mdata, format);
70 + } else {
71 + mrph_data_t data;
72 ++ mrph_t m;
73 + long index = mdata->compound;
74 + int has_next = 1;
75 + char *headword = mrph->headword;
76 +
77 ++ data.mrph = &m;
78 ++
79 + while (has_next) {
80 + has_next = get_compound(&data, headword, mrph->darts, index);
81 + if (!has_next) {