summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Kjellerstedt <pkj@axis.com>2018-04-26 02:20:33 +0200
committerPeter Kjellerstedt <pkj@axis.com>2018-04-26 02:20:33 +0200
commit6093e80932f72c8eec364cc03851a2386a0a2a39 (patch)
tree0fe84536c3a25ae669deb34c3a51b8a58b6c807d
parent2a7881ee8135808d55b5c3c26e45d5979604571a (diff)
downloadmeta-gplv2-6093e80932f72c8eec364cc03851a2386a0a2a39.tar.gz
patch: Make it build with compile time hardening enabled
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
-rw-r--r--recipes-devtools/patch/patch/0001-Make-it-build-with-compile-time-hardening-enabled.patch97
-rw-r--r--recipes-devtools/patch/patch_2.5.9.bb3
2 files changed, 99 insertions, 1 deletions
diff --git a/recipes-devtools/patch/patch/0001-Make-it-build-with-compile-time-hardening-enabled.patch b/recipes-devtools/patch/patch/0001-Make-it-build-with-compile-time-hardening-enabled.patch
new file mode 100644
index 0000000..31d8632
--- /dev/null
+++ b/recipes-devtools/patch/patch/0001-Make-it-build-with-compile-time-hardening-enabled.patch
@@ -0,0 +1,97 @@
1From eae20c82ee6eb2f50482f7c90baaf001240ed084 Mon Sep 17 00:00:00 2001
2From: Peter Kjellerstedt <pkj@axis.com>
3Date: Thu, 26 Apr 2018 02:15:43 +0200
4Subject: [PATCH] Make it build with compile time hardening enabled
5
6This avoids the following errors:
7
8 patch.c: In function 'apply_hunk':
9 patch.c:1179:7: error: format not a string literal and no format
10 arguments [-Werror=format-security]
11 fprintf (fp, outstate->after_newline + else_defined);
12 ^~~~~~~
13 patch.c:1198:7: error: format not a string literal and no format
14 arguments [-Werror=format-security]
15 fprintf (fp, outstate->after_newline + else_defined);
16 ^~~~~~~
17 patch.c:1246:3: error: format not a string literal and no format
18 arguments [-Werror=format-security]
19 fprintf (fp, outstate->after_newline + else_defined);
20 ^~~~~~~
21 patch.c:1265:3: error: format not a string literal and no format
22 arguments [-Werror=format-security]
23 fprintf (fp, outstate->after_newline + end_defined);
24 ^~~~~~~
25 patch.c:1283:3: error: format not a string literal and no format
26 arguments [-Werror=format-security]
27 fprintf (fp, outstate->after_newline + else_defined);
28 ^~~~~~~
29 patch.c:1302:2: error: format not a string literal and no format
30 arguments [-Werror=format-security]
31 fprintf (fp, outstate->after_newline + end_defined);
32 ^~~~~~~
33
34Upstream-Status: Inappropriate [legacy version]
35Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
36---
37 patch.c | 12 ++++++------
38 1 file changed, 6 insertions(+), 6 deletions(-)
39
40diff --git a/patch.c b/patch.c
41index 0d9a196..5e663a6 100644
42--- a/patch.c
43+++ b/patch.c
44@@ -1176,7 +1176,7 @@ apply_hunk (struct outstate *outstate, LINENUM where)
45 def_state = IN_IFNDEF;
46 }
47 else if (def_state == IN_IFDEF) {
48- fprintf (fp, outstate->after_newline + else_defined);
49+ fprintf (fp, "%s", outstate->after_newline + else_defined);
50 def_state = IN_ELSE;
51 }
52 if (ferror (fp))
53@@ -1195,7 +1195,7 @@ apply_hunk (struct outstate *outstate, LINENUM where)
54 return false;
55 if (R_do_defines) {
56 if (def_state == IN_IFNDEF) {
57- fprintf (fp, outstate->after_newline + else_defined);
58+ fprintf (fp, "%s", outstate->after_newline + else_defined);
59 def_state = IN_ELSE;
60 }
61 else if (def_state == OUTSIDE) {
62@@ -1243,7 +1243,7 @@ apply_hunk (struct outstate *outstate, LINENUM where)
63 while (pch_char (old) == '!');
64
65 if (R_do_defines) {
66- fprintf (fp, outstate->after_newline + else_defined);
67+ fprintf (fp, "%s", outstate->after_newline + else_defined);
68 if (ferror (fp))
69 write_fatal ();
70 def_state = IN_ELSE;
71@@ -1262,7 +1262,7 @@ apply_hunk (struct outstate *outstate, LINENUM where)
72 old++;
73 new++;
74 if (R_do_defines && def_state != OUTSIDE) {
75- fprintf (fp, outstate->after_newline + end_defined);
76+ fprintf (fp, "%s", outstate->after_newline + end_defined);
77 if (ferror (fp))
78 write_fatal ();
79 outstate->after_newline = true;
80@@ -1280,7 +1280,7 @@ apply_hunk (struct outstate *outstate, LINENUM where)
81 def_state = IN_IFDEF;
82 }
83 else if (def_state == IN_IFNDEF) {
84- fprintf (fp, outstate->after_newline + else_defined);
85+ fprintf (fp, "%s", outstate->after_newline + else_defined);
86 def_state = IN_ELSE;
87 }
88 if (ferror (fp))
89@@ -1299,7 +1299,7 @@ apply_hunk (struct outstate *outstate, LINENUM where)
90 while (new <= pat_end && pch_char (new) == '+');
91 }
92 if (R_do_defines && def_state != OUTSIDE) {
93- fprintf (fp, outstate->after_newline + end_defined);
94+ fprintf (fp, "%s", outstate->after_newline + end_defined);
95 if (ferror (fp))
96 write_fatal ();
97 outstate->after_newline = true;
diff --git a/recipes-devtools/patch/patch_2.5.9.bb b/recipes-devtools/patch/patch_2.5.9.bb
index c29b240..f2970f7 100644
--- a/recipes-devtools/patch/patch_2.5.9.bb
+++ b/recipes-devtools/patch/patch_2.5.9.bb
@@ -4,7 +4,8 @@ LICENSE = "GPLv2"
4SRC_URI += " file://debian.patch \ 4SRC_URI += " file://debian.patch \
5 file://install.patch \ 5 file://install.patch \
6 file://unified-reject-files.diff \ 6 file://unified-reject-files.diff \
7 file://global-reject-file.diff " 7 file://global-reject-file.diff \
8 file://0001-Make-it-build-with-compile-time-hardening-enabled.patch"
8PR = "r3" 9PR = "r3"
9 10
10LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" 11LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f"