From 08afd879388514af24e2c720066d479cfc71a433 Mon Sep 17 00:00:00 2001 From: Peter Kjellerstedt Date: Tue, 3 Oct 2017 22:26:41 +0200 Subject: groff: Make it build with compile time hardening enabled This avoids the following error: src/devices/grohtml/post-html.cc: In member function 'void header_desc::write_headings(FILE*, int)': src/devices/grohtml/post-html.cc:1402:32: error: format not a string literal and no format arguments [-Werror=format-security] fprintf(f, buffer.contents()); Signed-off-by: Peter Kjellerstedt Signed-off-by: Ross Burton --- ...build-with-compile-time-hardening-enabled.patch | 35 ++++++++++++++++++++++ recipes-extended/groff/groff_1.18.1.4.bb | 13 ++++---- 2 files changed, 42 insertions(+), 6 deletions(-) create mode 100644 recipes-extended/groff/groff-1.18.1.4/0001-Make-it-build-with-compile-time-hardening-enabled.patch (limited to 'recipes-extended') diff --git a/recipes-extended/groff/groff-1.18.1.4/0001-Make-it-build-with-compile-time-hardening-enabled.patch b/recipes-extended/groff/groff-1.18.1.4/0001-Make-it-build-with-compile-time-hardening-enabled.patch new file mode 100644 index 0000000..43404fa --- /dev/null +++ b/recipes-extended/groff/groff-1.18.1.4/0001-Make-it-build-with-compile-time-hardening-enabled.patch @@ -0,0 +1,35 @@ +From a1cd31daf05023a14d8e904a409cecbfc0fae93e Mon Sep 17 00:00:00 2001 +From: Peter Kjellerstedt +Date: Mon, 2 Oct 2017 14:34:14 +0200 +Subject: [PATCH 1/2] Make it build with compile time hardening enabled + +This avoids the following error: + + src/devices/grohtml/post-html.cc: In member function 'void + header_desc::write_headings(FILE*, int)': + src/devices/grohtml/post-html.cc:1402:32: error: format not a string + literal and no format arguments [-Werror=format-security] + fprintf(f, buffer.contents()); + +Upstream-Status: Inappropriate [legacy version] +Signed-off-by: Peter Kjellerstedt +--- + src/devices/grohtml/post-html.cc | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/devices/grohtml/post-html.cc b/src/devices/grohtml/post-html.cc +index 3c09d7c..1ad5580 100644 +--- a/src/devices/grohtml/post-html.cc ++++ b/src/devices/grohtml/post-html.cc +@@ -1399,7 +1399,7 @@ void header_desc::write_headings (FILE *f, int force) + + buffer += as_string(h); + buffer += '\0'; +- fprintf(f, buffer.contents()); ++ fprintf(f, "%s", buffer.contents()); + } else + fputs(g->text_string, f); + h++; +-- +2.12.0 + diff --git a/recipes-extended/groff/groff_1.18.1.4.bb b/recipes-extended/groff/groff_1.18.1.4.bb index fc7eb44..0d1520d 100644 --- a/recipes-extended/groff/groff_1.18.1.4.bb +++ b/recipes-extended/groff/groff_1.18.1.4.bb @@ -9,12 +9,13 @@ PR = "r1" LIC_FILES_CHKSUM = "file://COPYING;md5=e43fc16fccd8519fba405f0a0ff6e8a3" SRC_URI = "${GNU_MIRROR}/${BPN}/old/${BP}.tar.gz \ - file://groff-1.18.1.4-remove-mom.patch;striplevel=1 \ - file://man-local.patch \ - file://mdoc-local.patch \ - file://groff-1.18.1.4-fix-bindir.patch \ - file://fix-narrowing-conversion-error.patch \ -" + file://groff-1.18.1.4-remove-mom.patch;striplevel=1 \ + file://man-local.patch \ + file://mdoc-local.patch \ + file://groff-1.18.1.4-fix-bindir.patch \ + file://fix-narrowing-conversion-error.patch \ + file://0001-Make-it-build-with-compile-time-hardening-enabled.patch \ +" inherit autotools texinfo -- cgit v1.2.3-54-g00ecf