public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-text/fbpdf/files/, app-text/fbpdf/
@ 2020-03-25 19:46 Sergei Trofimovich
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Trofimovich @ 2020-03-25 19:46 UTC (permalink / raw
  To: gentoo-commits

commit:     c5ebe7c33f634a80a9137bdee9e856bc30e01509
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed Mar 25 19:46:02 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Wed Mar 25 19:46:18 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5ebe7c3

app-text/fbpdf: backport -Werror=format-security fix, bug #714736

Reported-by: Toralf Förster
Closes: https://bugs.gentoo.org/714736
Package-Manager: Portage-2.3.95, Repoman-2.3.21
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 app-text/fbpdf/fbpdf-0_p20190202.ebuild            |  3 +-
 .../fbpdf/files/fbpdf-0_p20190202-printf.patch     | 38 ++++++++++++++++++++++
 2 files changed, 40 insertions(+), 1 deletion(-)

diff --git a/app-text/fbpdf/fbpdf-0_p20190202.ebuild b/app-text/fbpdf/fbpdf-0_p20190202.ebuild
index 029af2a8ece..1ab615ca107 100644
--- a/app-text/fbpdf/fbpdf-0_p20190202.ebuild
+++ b/app-text/fbpdf/fbpdf-0_p20190202.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=6
@@ -34,6 +34,7 @@ S=${WORKDIR}/${P}-${COMMIT}
 
 PATCHES=(
 	"${FILESDIR}"/${P}-use-pkg-config.patch
+	"${FILESDIR}"/${P}-printf.patch
 )
 
 src_compile() {

diff --git a/app-text/fbpdf/files/fbpdf-0_p20190202-printf.patch b/app-text/fbpdf/files/fbpdf-0_p20190202-printf.patch
new file mode 100644
index 00000000000..31f9fbe2c8a
--- /dev/null
+++ b/app-text/fbpdf/files/fbpdf-0_p20190202-printf.patch
@@ -0,0 +1,38 @@
+https://bugs.gentoo.org/714736
+
+From e89e36c01d09ca6aec03732e922e749257cac3f4 Mon Sep 17 00:00:00 2001
+From: Dmitry Bogatov <KAction@disroot.org>
+Date: Sun, 9 Feb 2020 00:47:09 -0500
+Subject: [PATCH] Avoid passing non-constant format string to printf
+
+gcc complains loudly on any code that uses anything but string literal
+as format string to printf. Right now format string is "const char *"
+and does not contain %-sequences, but should '%' appear in "usage"
+string in future, bad things would happen.
+
+Since formatting functionality of "printf" is not used anyway, replacing
+it with "puts" makes code both safer and easier to understand.
+---
+ fbpdf.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/fbpdf.c b/fbpdf.c
+index a58797f..65b654b 100644
+--- a/fbpdf.c
++++ b/fbpdf.c
+@@ -351,13 +351,13 @@ static void mainloop(void)
+ }
+ 
+ static char *usage =
+-	"usage: fbpdf [-r rotation] [-z zoom x10] [-p page] filename\n";
++	"usage: fbpdf [-r rotation] [-z zoom x10] [-p page] filename";
+ 
+ int main(int argc, char *argv[])
+ {
+ 	int i = 1;
+ 	if (argc < 2) {
+-		printf(usage);
++		puts(usage);
+ 		return 1;
+ 	}
+ 	strcpy(filename, argv[argc - 1]);


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-text/fbpdf/files/, app-text/fbpdf/
@ 2020-08-03 21:44 Sergei Trofimovich
  0 siblings, 0 replies; 2+ messages in thread
From: Sergei Trofimovich @ 2020-08-03 21:44 UTC (permalink / raw
  To: gentoo-commits

commit:     4e50f73bb773fd6e0e2ae9a7b199c2d0f0d6eaea
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Mon Aug  3 21:41:03 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Mon Aug  3 21:43:59 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e50f73b

app-text/fbpdf: depend on only direct pkg-config files

Reported-by: John Helmert III (ajak)
Bug: https://bugs.gentoo.org/735588
Package-Manager: Portage-3.0.1, Repoman-2.3.23
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 app-text/fbpdf/fbpdf-0_p20190202-r1.ebuild         | 43 ++++++++++++++++++++++
 .../files/fbpdf-0_p20190202-drop-unused.patch      | 16 ++++++++
 2 files changed, 59 insertions(+)

diff --git a/app-text/fbpdf/fbpdf-0_p20190202-r1.ebuild b/app-text/fbpdf/fbpdf-0_p20190202-r1.ebuild
new file mode 100644
index 00000000000..79bea0cffbd
--- /dev/null
+++ b/app-text/fbpdf/fbpdf-0_p20190202-r1.ebuild
@@ -0,0 +1,43 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit toolchain-funcs vcs-snapshot
+
+COMMIT="dfe9f0067549f759cdc04f2f62b4f89cd6e1b199"
+
+DESCRIPTION="framebuffer pdf and djvu viewer"
+HOMEPAGE="https://github.com/aligrudi/fbpdf"
+
+SRC_URI="https://github.com/aligrudi/fbpdf/archive/${COMMIT}.tar.gz -> ${P}-${COMMIT}.tar.gz"
+
+LICENSE="BSD ISC"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+RDEPEND="
+	>=app-text/mupdf-1.10:0=
+	app-text/djvu:0=
+	!media-gfx/fbida[fbcon(-)]
+"
+
+DEPEND="${RDEPEND}"
+
+BDEPEND="virtual/pkgconfig"
+
+S=${WORKDIR}/${P}-${COMMIT}
+
+PATCHES=(
+	"${FILESDIR}"/${P}-use-pkg-config.patch
+	"${FILESDIR}"/${P}-printf.patch
+)
+
+src_compile() {
+	emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+	dobin fbpdf fbdjvu
+	dodoc README
+}

diff --git a/app-text/fbpdf/files/fbpdf-0_p20190202-drop-unused.patch b/app-text/fbpdf/files/fbpdf-0_p20190202-drop-unused.patch
new file mode 100644
index 00000000000..3e60b914943
--- /dev/null
+++ b/app-text/fbpdf/files/fbpdf-0_p20190202-drop-unused.patch
@@ -0,0 +1,16 @@
+--- a/Makefile
++++ b/Makefile
+@@ -12,11 +12,11 @@ clean:
+ 
+ # pdf support using mupdf
+ fbpdf: fbpdf.o mupdf.o draw.o
+-	$(CC) -o $@ $^ $(LDFLAGS) $(shell $(PKG_CONFIG) --libs mupdf) -lm
++	$(CC) -o $@ $^ $(LDFLAGS) $(shell $(PKG_CONFIG) --libs mupdf)
+ 
+ # djvu support
+ fbdjvu: fbpdf.o djvulibre.o draw.o
+-	$(CXX) -o $@ $^ $(LDFLAGS) $(shell $(PKG_CONFIG) --libs ddjvuapi) -ljpeg -lm -lpthread
++	$(CXX) -o $@ $^ $(LDFLAGS) $(shell $(PKG_CONFIG) --libs ddjvuapi)
+ 
+ # pdf support using poppler
+ poppler.o: poppler.c


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-03 21:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-03 21:44 [gentoo-commits] repo/gentoo:master commit in: app-text/fbpdf/files/, app-text/fbpdf/ Sergei Trofimovich
  -- strict thread matches above, loose matches on Subject: below --
2020-03-25 19:46 Sergei Trofimovich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox