summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkinori Hattori <hattya@gentoo.org>2021-11-22 23:51:57 +0900
committerAkinori Hattori <hattya@gentoo.org>2021-11-22 23:51:57 +0900
commitf79eeb6f40f8f00c9b757066c25892c1ca812732 (patch)
treec19028b35a99ec85e5224dc93b0a01199ee613e8 /app-text/chasen
parentapp-text/chasen: update to version 2.4.5 (diff)
downloadgentoo-f79eeb6f40f8f00c9b757066c25892c1ca812732.tar.gz
gentoo-f79eeb6f40f8f00c9b757066c25892c1ca812732.tar.bz2
gentoo-f79eeb6f40f8f00c9b757066c25892c1ca812732.zip
app-text/chasen: fix stack use after return
Closes: https://bugs.gentoo.org/825018 Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Akinori Hattori <hattya@gentoo.org>
Diffstat (limited to 'app-text/chasen')
-rw-r--r--app-text/chasen/chasen-2.4.5.ebuild2
-rw-r--r--app-text/chasen/files/chasen-uar.patch44
2 files changed, 46 insertions, 0 deletions
diff --git a/app-text/chasen/chasen-2.4.5.ebuild b/app-text/chasen/chasen-2.4.5.ebuild
index 48d64ea7ef9a..d7433b71a1f0 100644
--- a/app-text/chasen/chasen-2.4.5.ebuild
+++ b/app-text/chasen/chasen-2.4.5.ebuild
@@ -18,6 +18,8 @@ RDEPEND="virtual/libiconv"
DEPEND=">=dev-libs/darts-0.32"
PDEPEND=">=app-dicts/ipadic-2.7.0"
+PATCHES=( "${FILESDIR}"/${PN}-uar.patch )
+
src_configure() {
econf $(use_enable static-libs static)
diff --git a/app-text/chasen/files/chasen-uar.patch b/app-text/chasen/files/chasen-uar.patch
new file mode 100644
index 000000000000..631e0890f751
--- /dev/null
+++ b/app-text/chasen/files/chasen-uar.patch
@@ -0,0 +1,44 @@
+--- a/lib/print.c
++++ b/lib/print.c
+@@ -997,20 +997,20 @@
+ static int
+ get_compound(mrph_data_t *data, char *headword, darts_t *da, long index)
+ {
+- mrph_t mrph;
++ mrph_t *mrph = data->mrph;
+ int has_next, hw_len;
+ char *base = da_get_lex_base(da) + index;
+
+ hw_len = ((short *)base)[0];
+ has_next = ((short *)base)[1];
+ base += sizeof(short) * 2;
+- memcpy(&mrph, base, sizeof(da_lex_t));
+- mrph.headword = headword;
+- mrph.headword_len = hw_len;
+- mrph.is_undef = 0;
+- mrph.darts = da;
++ memcpy(mrph, base, sizeof(da_lex_t));
++ mrph->headword = headword;
++ mrph->headword_len = hw_len;
++ mrph->is_undef = 0;
++ mrph->darts = da;
+
+- get_mrph_data(&mrph, data);
++ get_mrph_data(mrph, data);
+
+ return has_next;
+ }
+@@ -1028,10 +1028,13 @@
+ cha_printf_mrph(lat, path_num, mdata, format);
+ } else {
+ mrph_data_t data;
++ mrph_t m;
+ long index = mdata->compound;
+ int has_next = 1;
+ char *headword = mrph->headword;
+
++ data.mrph = &m;
++
+ while (has_next) {
+ has_next = get_compound(&data, headword, mrph->darts, index);
+ if (!has_next) {