Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-board/gtkboard/files/, games-board/gtkboard/
Date: Tue, 02 Jun 2020 18:09:47
Message-Id: 1591121367.814edc7a6629c2243d94ed9147d8cfc76e7da2e5.asturm@gentoo
1 commit: 814edc7a6629c2243d94ed9147d8cfc76e7da2e5
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 2 18:07:17 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 2 18:09:27 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=814edc7a
7
8 games-board/gtkboard: EAPI-7 bump, drop IUSE=gnome, libgnomeui--
9
10 - Fix stack smashing bug
11 - Missing || die
12 - Use desktop.eclass instead of eutils.eclass
13 - Use HTML_DOCS for index.html doc
14
15 Debian-bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=948527
16 Closes: https://bugs.gentoo.org/644324
17 Package-Manager: Portage-2.3.100, Repoman-2.3.22
18 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
19
20 .../files/gtkboard-0.11_pre0-stack-smash.patch | 32 +++++++++++++
21 games-board/gtkboard/gtkboard-0.11_pre0-r2.ebuild | 53 ++++++++++++++++++++++
22 2 files changed, 85 insertions(+)
23
24 diff --git a/games-board/gtkboard/files/gtkboard-0.11_pre0-stack-smash.patch b/games-board/gtkboard/files/gtkboard-0.11_pre0-stack-smash.patch
25 new file mode 100644
26 index 00000000000..412412eb62a
27 --- /dev/null
28 +++ b/games-board/gtkboard/files/gtkboard-0.11_pre0-stack-smash.patch
29 @@ -0,0 +1,32 @@
30 +From: Takahide Nojima <nozzy123nozzy@×××××.com>
31 +Date: Mon, 6 Jan 2020 02:01:42 +0900
32 +Subject: fixed-stack-smash
33 +
34 +Fix stack overflow in engine.c.
35 +It has 2 overflows.
36 + -The 'linebuf' have 4096 bytes,but '\0' puts in 4097th.
37 + -The last argument of g_io_channel_read should be
38 + 'unsigned long' not 'int'.
39 +
40 +See https://bugs.debian.org/948527
41 +---
42 + src/engine.c | 4 ++--
43 + 1 file changed, 2 insertions(+), 2 deletions(-)
44 +
45 +diff --git a/src/engine.c b/src/engine.c
46 +index 1b733fb..6ad3b9a 100644
47 +--- a/src/engine.c
48 ++++ b/src/engine.c
49 +@@ -345,10 +345,10 @@ static gboolean process_line ()
50 +
51 + static gboolean channel_process_input ()
52 + {
53 +- static char linebuf[4096];
54 ++ static char linebuf[4096+1];
55 + char *linep = linebuf;
56 + char *line;
57 +- int bytes_read;
58 ++ gsize bytes_read;
59 + #if GLIB_MAJOR_VERSION > 1
60 + // we need to call this again because we will get new events before returning
61 + // from this function
62
63 diff --git a/games-board/gtkboard/gtkboard-0.11_pre0-r2.ebuild b/games-board/gtkboard/gtkboard-0.11_pre0-r2.ebuild
64 new file mode 100644
65 index 00000000000..2886f2c69ad
66 --- /dev/null
67 +++ b/games-board/gtkboard/gtkboard-0.11_pre0-r2.ebuild
68 @@ -0,0 +1,53 @@
69 +# Copyright 1999-2020 Gentoo Authors
70 +# Distributed under the terms of the GNU General Public License v2
71 +
72 +EAPI=7
73 +
74 +MY_P=${P/_}
75 +inherit desktop
76 +
77 +DESCRIPTION="Board games system"
78 +HOMEPAGE="http://gtkboard.sourceforge.net/indexold.html"
79 +SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
80 +
81 +LICENSE="GPL-2"
82 +SLOT="0"
83 +KEYWORDS="~amd64 ~x86"
84 +IUSE=""
85 +
86 +BDEPEND="
87 + virtual/pkgconfig"
88 +RDEPEND="
89 + media-libs/libsdl:0[sound]
90 + media-libs/sdl-mixer[vorbis]
91 + x11-libs/gtk+:2"
92 +DEPEND="${RDEPEND}"
93 +
94 +HTML_DOCS=( doc/index.html )
95 +
96 +S="${WORKDIR}/${MY_P}"
97 +
98 +PATCHES=(
99 + "${FILESDIR}"/${P}-gcc41.patch
100 + "${FILESDIR}"/${P}-gcc45.patch
101 + "${FILESDIR}"/${P}-stack-smash.patch
102 +)
103 +
104 +src_prepare() {
105 + default
106 +
107 + sed -i -e "/^LIBS/s:@LIBS@:@LIBS@ -lgmodule-2.0 -lm:" src/Makefile.in || die
108 +}
109 +
110 +src_configure() {
111 + econf \
112 + --enable-gtk2 \
113 + --enable-sdl \
114 + --disable-gnome
115 +}
116 +
117 +src_install() {
118 + default
119 + doicon pixmaps/${PN}.png
120 + make_desktop_entry ${PN} Gtkboard
121 +}