rjw | 1f88458 | 2022-01-06 17:20:42 +0800 | [diff] [blame^] | 1 | From a1cd31daf05023a14d8e904a409cecbfc0fae93e Mon Sep 17 00:00:00 2001 |
| 2 | From: Peter Kjellerstedt <pkj@axis.com> |
| 3 | Date: Mon, 2 Oct 2017 14:34:14 +0200 |
| 4 | Subject: [PATCH 1/2] Make it build with compile time hardening enabled |
| 5 | |
| 6 | This avoids the following error: |
| 7 | |
| 8 | src/devices/grohtml/post-html.cc: In member function 'void |
| 9 | header_desc::write_headings(FILE*, int)': |
| 10 | src/devices/grohtml/post-html.cc:1402:32: error: format not a string |
| 11 | literal and no format arguments [-Werror=format-security] |
| 12 | fprintf(f, buffer.contents()); |
| 13 | |
| 14 | Upstream-Status: Inappropriate [legacy version] |
| 15 | Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> |
| 16 | --- |
| 17 | src/devices/grohtml/post-html.cc | 2 +- |
| 18 | 1 file changed, 1 insertion(+), 1 deletion(-) |
| 19 | |
| 20 | diff --git a/src/devices/grohtml/post-html.cc b/src/devices/grohtml/post-html.cc |
| 21 | index 3c09d7c..1ad5580 100644 |
| 22 | --- a/src/devices/grohtml/post-html.cc |
| 23 | +++ b/src/devices/grohtml/post-html.cc |
| 24 | @@ -1399,7 +1399,7 @@ void header_desc::write_headings (FILE *f, int force) |
| 25 | |
| 26 | buffer += as_string(h); |
| 27 | buffer += '\0'; |
| 28 | - fprintf(f, buffer.contents()); |
| 29 | + fprintf(f, "%s", buffer.contents()); |
| 30 | } else |
| 31 | fputs(g->text_string, f); |
| 32 | h++; |
| 33 | -- |
| 34 | 2.12.0 |
| 35 | |