summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Draszik <adraszik@tycoint.com>2017-06-19 11:28:19 +0100
committerRoss Burton <ross.burton@intel.com>2017-06-22 13:39:38 +0100
commit334171d7b00e61b58041f2d4f4df1f8038ad61d4 (patch)
tree1e4b9b999dfea21f709e43ad508aaba943664185
parent6bdb814f247b826dc2eebc13517831a05e0e5e71 (diff)
downloadmeta-gplv2-334171d7b00e61b58041f2d4f4df1f8038ad61d4.tar.gz
grep: fix compilation with security flags enabled
As per attached patch Signed-off-by: André Draszik <adraszik@tycoint.com> Acked-by: Sylvain Lemieux <slemieux@tycoint.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--recipes-extended/grep/grep-2.5.1a/search-fix-compilation-error-with-security-flags-ena.patch134
-rw-r--r--recipes-extended/grep/grep_2.5.1a.bb1
2 files changed, 135 insertions, 0 deletions
diff --git a/recipes-extended/grep/grep-2.5.1a/search-fix-compilation-error-with-security-flags-ena.patch b/recipes-extended/grep/grep-2.5.1a/search-fix-compilation-error-with-security-flags-ena.patch
new file mode 100644
index 0000000..e6fac82
--- /dev/null
+++ b/recipes-extended/grep/grep-2.5.1a/search-fix-compilation-error-with-security-flags-ena.patch
@@ -0,0 +1,134 @@
1From cc5ffe68438bef47c2313705afc0101eba640092 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com>
3Date: Thu, 23 Mar 2017 12:42:38 +0000
4Subject: [PATCH] search: fix compilation error with security flags enabled
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9| ../../grep-2.5.1a/src/search.c: In function 'dfaerror':
10| ../../grep-2.5.1a/src/search.c:106:3: error: format not a string literal and no format arguments [-Werror=format-security]
11| error (2, 0, mesg);
12| ^~~~~
13
14Upstream-Status: Inappropriate [required for grep 2.5.1a (GPLv2) recipe only]
15Signed-off-by: André Draszik <adraszik@tycoint.com>
16---
17 src/search.c | 26 +++++++++++++-------------
18 1 file changed, 13 insertions(+), 13 deletions(-)
19
20diff --git a/src/search.c b/src/search.c
21index 3c6a485..9cee0d8 100644
22--- a/src/search.c
23+++ b/src/search.c
24@@ -103,7 +103,7 @@ check_utf8 (void)
25 void
26 dfaerror (char const *mesg)
27 {
28- error (2, 0, mesg);
29+ error (2, 0, "%s", mesg);
30 }
31
32 static void
33@@ -142,7 +142,7 @@ kwsmusts (void)
34 continue;
35 ++kwset_exact_matches;
36 if ((err = kwsincr (kwset, dm->must, strlen (dm->must))) != 0)
37- error (2, 0, err);
38+ error (2, 0, "%s", err);
39 }
40 /* Now, we compile the substrings that will require
41 the use of the regexp matcher. */
42@@ -151,10 +151,10 @@ kwsmusts (void)
43 if (dm->exact)
44 continue;
45 if ((err = kwsincr (kwset, dm->must, strlen (dm->must))) != 0)
46- error (2, 0, err);
47+ error (2, 0, "%s", err);
48 }
49 if ((err = kwsprep (kwset)) != 0)
50- error (2, 0, err);
51+ error (2, 0, "%s", err);
52 }
53 }
54
55@@ -198,7 +198,7 @@ Gcompile (char const *pattern, size_t size)
56
57 if ((err = re_compile_pattern (motif, len,
58 &(patterns[pcount].regexbuf))) != 0)
59- error (2, 0, err);
60+ error (2, 0, "%s", err);
61 pcount++;
62
63 motif = sep;
64@@ -286,7 +286,7 @@ Ecompile (char const *pattern, size_t size)
65
66 if ((err = re_compile_pattern (motif, len,
67 &(patterns[pcount].regexbuf))) != 0)
68- error (2, 0, err);
69+ error (2, 0, "%s", err);
70 pcount++;
71
72 motif = sep;
73@@ -755,7 +755,7 @@ fimb_fail:
74 if (wclen == 0)
75 {
76 if ((err = kwsincr (fimb_kwset, "", 0)) != 0)
77- error (2, 0, err);
78+ error (2, 0, "%s", err);
79 }
80 else
81 for (i = 0; i < (1 << wclen); i++)
82@@ -778,7 +778,7 @@ fimb_fail:
83 p += k;
84 }
85 if ((err = kwsincr (fimb_kwset, starts, p - starts)) != 0)
86- error (2, 0, err);
87+ error (2, 0, "%s", err);
88 }
89 if (wclim < wcpattern + wcsize)
90 ++wclim;
91@@ -790,7 +790,7 @@ fimb_fail:
92 free (starts);
93 Fimb.match = xmalloc (Fimb.count);
94 if ((err = kwsprep (kwset)) != 0)
95- error (2, 0, err);
96+ error (2, 0, "%s", err);
97 return;
98 }
99 }
100@@ -804,7 +804,7 @@ fimb_fail:
101 for (lim = beg; lim < pattern + size && *lim != '\n'; ++lim)
102 ;
103 if ((err = kwsincr (kwset, beg, lim - beg)) != 0)
104- error (2, 0, err);
105+ error (2, 0, "%s", err);
106 if (lim < pattern + size)
107 ++lim;
108 beg = lim;
109@@ -812,7 +812,7 @@ fimb_fail:
110 while (beg < pattern + size);
111
112 if ((err = kwsprep (kwset)) != 0)
113- error (2, 0, err);
114+ error (2, 0, "%s", err);
115 }
116
117 #ifdef MBS_SUPPORT
118@@ -1220,11 +1220,11 @@ Pcompile (char const *pattern, size_t size)
119
120 cre = pcre_compile (re, flags, &ep, &e, pcre_maketables ());
121 if (!cre)
122- error (2, 0, ep);
123+ error (2, 0, "%s", ep);
124
125 extra = pcre_study (cre, 0, &ep);
126 if (ep)
127- error (2, 0, ep);
128+ error (2, 0, "%s", ep);
129
130 free (re);
131 #endif
132--
1332.11.0
134
diff --git a/recipes-extended/grep/grep_2.5.1a.bb b/recipes-extended/grep/grep_2.5.1a.bb
index 5a2da28..97ca768 100644
--- a/recipes-extended/grep/grep_2.5.1a.bb
+++ b/recipes-extended/grep/grep_2.5.1a.bb
@@ -16,6 +16,7 @@ SRC_URI = "${GNU_MIRROR}/grep/grep-${PV}.tar.bz2 \
16 file://grep-CVE-2012-5667.patch \ 16 file://grep-CVE-2012-5667.patch \
17 file://fix-for-texinfo-5.1.patch \ 17 file://fix-for-texinfo-5.1.patch \
18 file://grep-egrep-fgrep-Fix-LSB-NG-cases.patch \ 18 file://grep-egrep-fgrep-Fix-LSB-NG-cases.patch \
19 file://search-fix-compilation-error-with-security-flags-ena.patch \
19 " 20 "
20 21
21SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c" 22SRC_URI[md5sum] = "52202fe462770fa6be1bb667bd6cf30c"