aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-extended/libidn/libidn/0001-idn-format-security-warnings.patch
blob: d5fb8e7c821eff137f5e6cd3cd51173d4e803686 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
Subject: [PATCH] idn: fix printf() format security warnings
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

| ../../libidn-1.32/src/idn.c: In function 'main':
| ../../libidn-1.32/src/idn.c:172:7: error: format not a string literal and no format arguments [-Werror=format-security]
|        error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified"));
|        ^~~~~
| ../../libidn-1.32/src/idn.c:187:5: error: format not a string literal and no format arguments [-Werror=format-security]
|      fprintf (stderr, _("Type each input string on a line by itself, "
|      ^~~~~~~
| ../../libidn-1.32/src/idn.c:202:4: error: format not a string literal and no format arguments [-Werror=format-security]
|     error (EXIT_FAILURE, errno, _("input error"));
|     ^~~~~
| ../../libidn-1.32/src/idn.c:220:8: error: format not a string literal and no format arguments [-Werror=format-security]
|         _("could not convert from UTF-8 to UCS-4"));
|         ^
| ../../libidn-1.32/src/idn.c:245:8: error: format not a string literal and no format arguments [-Werror=format-security]
|         _("could not convert from UTF-8 to UCS-4"));
|         ^
| ../../libidn-1.32/src/idn.c:281:6: error: format not a string literal and no format arguments [-Werror=format-security]
|       _("could not convert from UTF-8 to UCS-4"));
|       ^
| ../../libidn-1.32/src/idn.c:340:6: error: format not a string literal and no format arguments [-Werror=format-security]
|       _("could not convert from UCS-4 to UTF-8"));
|       ^
| ../../libidn-1.32/src/idn.c:364:6: error: format not a string literal and no format arguments [-Werror=format-security]
|       _("could not convert from UCS-4 to UTF-8"));
|       ^
| ../../libidn-1.32/src/idn.c:442:8: error: format not a string literal and no format arguments [-Werror=format-security]
|         _("could not convert from UCS-4 to UTF-8"));
|         ^
| ../../libidn-1.32/src/idn.c:498:6: error: format not a string literal and no format arguments [-Werror=format-security]
|       _("could not convert from UTF-8 to UCS-4"));
|       ^
| ../../libidn-1.32/src/idn.c:527:5: error: format not a string literal and no format arguments [-Werror=format-security]
|      _("could not convert from UTF-8 to UCS-4"));
|      ^
| ../../libidn-1.32/src/idn.c:540:6: error: format not a string literal and no format arguments [-Werror=format-security]
|       error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
|       ^~~~~
| ../../libidn-1.32/src/idn.c:551:5: error: format not a string literal and no format arguments [-Werror=format-security]
|      _("could not convert from UTF-8 to UCS-4"));
|      ^

Signed-off-by: André Draszik <adraszik@tycoint.com>
Signed-off-by: Zang Ruochen <zangrc.fnst@cn.fujitsu.com>

Upstream-Status: Pending

---
 src/idn.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/src/idn.c b/src/idn.c
index f2fee11..c6e5caa 100644
--- a/src/idn.c
+++ b/src/idn.c
@@ -169,7 +169,7 @@ main (int argc, char *argv[])
       (args_info.idna_to_unicode_given ? 1 : 0) +
       (args_info.nfkc_given ? 1 : 0) != 1)
     {
-      error (0, 0,
+      error (0, 0, "%s",
 	     _("only one of -s, -e, -d, -a, -u or -n can be specified"));
       usage (EXIT_FAILURE);
     }
@@ -183,7 +183,7 @@ main (int argc, char *argv[])
 
   if (!args_info.quiet_given
       && args_info.inputs_num == 0 && isatty (fileno (stdin)))
-    fprintf (stderr, _("Type each input string on a line by itself, "
+    fprintf (stderr, "%s", _("Type each input string on a line by itself, "
 		       "terminated by a newline character.\n"));
 
   do
@@ -195,7 +195,7 @@ main (int argc, char *argv[])
 	  if (feof (stdin))
 	    break;
 
-	  error (EXIT_FAILURE, errno, _("input error"));
+	  error (EXIT_FAILURE, errno, "%s", _("input error"));
 	}
 
       if (strlen (line) > 0)
@@ -213,7 +213,7 @@ main (int argc, char *argv[])
 	  if (!q)
 	    {
 	      free (p);
-	      error (EXIT_FAILURE, 0,
+	      error (EXIT_FAILURE, 0, "%s",
 		     _("could not convert from UTF-8 to UCS-4"));
 	    }
 
@@ -238,7 +238,7 @@ main (int argc, char *argv[])
 	  if (!q)
 	    {
 	      free (r);
-	      error (EXIT_FAILURE, 0,
+	      error (EXIT_FAILURE, 0, "%s",
 		     _("could not convert from UTF-8 to UCS-4"));
 	    }
 
@@ -275,7 +275,7 @@ main (int argc, char *argv[])
 	  q = stringprep_utf8_to_ucs4 (p, -1, &len);
 	  free (p);
 	  if (!q)
-	    error (EXIT_FAILURE, 0,
+	    error (EXIT_FAILURE, 0, "%s",
 		   _("could not convert from UTF-8 to UCS-4"));
 
 	  if (args_info.debug_given)
@@ -334,7 +334,7 @@ main (int argc, char *argv[])
 	  r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
 	  free (q);
 	  if (!r)
-	    error (EXIT_FAILURE, 0,
+	    error (EXIT_FAILURE, 0, "%s",
 		   _("could not convert from UCS-4 to UTF-8"));
 
 	  p = stringprep_utf8_to_locale (r);
@@ -358,7 +358,7 @@ main (int argc, char *argv[])
 	  q = stringprep_utf8_to_ucs4 (p, -1, NULL);
 	  free (p);
 	  if (!q)
-	    error (EXIT_FAILURE, 0,
+	    error (EXIT_FAILURE, 0, "%s",
 		   _("could not convert from UCS-4 to UTF-8"));
 
 	  if (args_info.debug_given)
@@ -436,7 +436,7 @@ main (int argc, char *argv[])
 	  if (!q)
 	    {
 	      free (p);
-	      error (EXIT_FAILURE, 0,
+	      error (EXIT_FAILURE, 0, "%s",
 		     _("could not convert from UCS-4 to UTF-8"));
 	    }
 
@@ -492,7 +492,7 @@ main (int argc, char *argv[])
 	  r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL);
 	  free (q);
 	  if (!r)
-	    error (EXIT_FAILURE, 0,
+	    error (EXIT_FAILURE, 0, "%s",
 		   _("could not convert from UTF-8 to UCS-4"));
 
 	  p = stringprep_utf8_to_locale (r);
@@ -521,7 +521,7 @@ main (int argc, char *argv[])
 	      if (!q)
 		{
 		  free (p);
-		  error (EXIT_FAILURE, 0,
+		  error (EXIT_FAILURE, 0, "%s",
 			 _("could not convert from UTF-8 to UCS-4"));
 		}
 
@@ -535,7 +535,8 @@ main (int argc, char *argv[])
 	  r = stringprep_utf8_nfkc_normalize (p, -1);
 	  free (p);
 	  if (!r)
-	    error (EXIT_FAILURE, 0, _("could not do NFKC normalization"));
+	    error (EXIT_FAILURE, 0, "%s",
+		   _("could not do NFKC normalization"));
 
 	  if (args_info.debug_given)
 	    {
@@ -545,7 +546,7 @@ main (int argc, char *argv[])
 	      if (!q)
 		{
 		  free (r);
-		  error (EXIT_FAILURE, 0,
+		  error (EXIT_FAILURE, 0, "%s",
 			 _("could not convert from UTF-8 to UCS-4"));
 		}
 
-- 
2.25.1