commit:     677a68abfac2720af13042540adbb5f43b6475c3
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 22 08:21:01 2019 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Sat Jun 22 08:21:44 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=677a68ab

dev-util/radare2: fix double-free in cmd_mount.c, bug #688336

Reported-by: D'juan McDonald (domhnall)
Bug: https://bugs.gentoo.org/688336
Package-Manager: Portage-2.3.67, Repoman-2.3.15
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../radare2/files/radare2-3.5.1-mount-free.patch   | 22 ++++++++
 dev-util/radare2/radare2-3.5.1-r1.ebuild           | 60 ++++++++++++++++++++++
 2 files changed, 82 insertions(+)

diff --git a/dev-util/radare2/files/radare2-3.5.1-mount-free.patch 
b/dev-util/radare2/files/radare2-3.5.1-mount-free.patch
new file mode 100644
index 00000000000..ad27596fc12
--- /dev/null
+++ b/dev-util/radare2/files/radare2-3.5.1-mount-free.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/688336
+
+From 40453029179d230cf02ffed205f2d63e33981b8f Mon Sep 17 00:00:00 2001
+From: pancake <[email protected]>
+Date: Mon, 17 Jun 2019 11:34:49 +0200
+Subject: [PATCH] Fix #14334 - Double-free in ms command
+
+---
+ libr/core/cmd_mount.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/libr/core/cmd_mount.c
++++ b/libr/core/cmd_mount.c
+@@ -471,7 +471,7 @@ static int cmd_mount(void *data, const char *_input) {
+                       rli->completion.run_user = rli->user;
+                       r_line_completion_set (&rli->completion, ms_argc, 
ms_argv);
+                       r_fs_shell_prompt (&shell, core->fs, input);
+-                      free (cwd);
++                      R_FREE (cwd);
+                       r_pvector_clear (&rli->completion.args);
+                       memcpy (&rli->completion, &c, sizeof (c));
+               }

diff --git a/dev-util/radare2/radare2-3.5.1-r1.ebuild 
b/dev-util/radare2/radare2-3.5.1-r1.ebuild
new file mode 100644
index 00000000000..781c3273fe4
--- /dev/null
+++ b/dev-util/radare2/radare2-3.5.1-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit bash-completion-r1 eutils
+
+DESCRIPTION="unix-like reverse engineering framework and commandline tools"
+HOMEPAGE="http://www.radare.org";
+
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/radare/radare2";
+else
+       SRC_URI="https://github.com/radare/radare2/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="ssl libressl"
+
+RDEPEND="
+       dev-libs/capstone:0=
+       ssl? (
+               !libressl? ( dev-libs/openssl:0= )
+               libressl? ( dev-libs/libressl:0= )
+       )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-3.5.1-mount-free.patch
+)
+
+src_configure() {
+       econf \
+               --without-libuv \
+               --with-syscapstone \
+               $(use_with ssl openssl)
+}
+
+src_install() {
+       default
+
+       insinto /usr/share/zsh/site-functions
+       doins doc/zsh/_*
+
+       newbashcomp doc/bash_autocompletion.sh "${PN}"
+       bashcomp_alias "${PN}" rafind2 r2 rabin2 rasm2 radiff2
+
+       # a workaround for unstable $(INSTALL) call, bug #574866
+       local d
+       for d in doc/*; do
+               if [[ -d $d ]]; then
+                       rm -rfv "$d" || die "failed to delete '$d'"
+               fi
+       done
+}

Reply via email to