xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-extended/zip/zip-3.0/fix-security-format.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyunzip: Fixing security formatting issues
2*4882a593Smuzhiyun
3*4882a593SmuzhiyunFix security formatting issues related to printing without NULL argument
4*4882a593Smuzhiyun
5*4882a593Smuzhiyunzip.c: In function 'help_extended':
6*4882a593Smuzhiyunzip.c:1031:5: error: format not a string literal and no format arguments [-Werror=format-security]
7*4882a593Smuzhiyun     printf(text[i]);
8*4882a593Smuzhiyun     ^
9*4882a593Smuzhiyunzip.c: In function 'version_info':
10*4882a593Smuzhiyunzip.c:1228:5: error: format not a string literal and no format arguments [-Werror=format-security]
11*4882a593Smuzhiyun     printf(cryptnote[i]);
12*4882a593Smuzhiyun     ^
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun[YOCTO #9552]
15*4882a593Smuzhiyun[https://bugzilla.yoctoproject.org/show_bug.cgi?id=9552]
16*4882a593Smuzhiyun
17*4882a593SmuzhiyunUpstream-Status: Inactive-Upstream [need a new release]
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunSigned-off-by: Edwin Plauchu <edwin.plauchu.camacho@intel.com>
20*4882a593Smuzhiyun
21*4882a593Smuzhiyundiff --git a/zip.c b/zip.c
22*4882a593Smuzhiyunindex 439821f..d7da768 100644
23*4882a593Smuzhiyun--- a/zip.c
24*4882a593Smuzhiyun+++ b/zip.c
25*4882a593Smuzhiyun@@ -1028,7 +1028,7 @@ local void help_extended()
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun   for (i = 0; i < sizeof(text)/sizeof(char *); i++)
28*4882a593Smuzhiyun   {
29*4882a593Smuzhiyun-    printf(text[i]);
30*4882a593Smuzhiyun+    fputs(text[i],stdout);
31*4882a593Smuzhiyun     putchar('\n');
32*4882a593Smuzhiyun   }
33*4882a593Smuzhiyun #ifdef DOS
34*4882a593Smuzhiyun@@ -1225,7 +1225,7 @@ local void version_info()
35*4882a593Smuzhiyun             CR_MAJORVER, CR_MINORVER, CR_BETA_VER, CR_VERSION_DATE);
36*4882a593Smuzhiyun   for (i = 0; i < sizeof(cryptnote)/sizeof(char *); i++)
37*4882a593Smuzhiyun   {
38*4882a593Smuzhiyun-    printf(cryptnote[i]);
39*4882a593Smuzhiyun+    fputs(cryptnote[i],stdout);
40*4882a593Smuzhiyun     putchar('\n');
41*4882a593Smuzhiyun   }
42*4882a593Smuzhiyun   ++i;  /* crypt support means there IS at least one compilation option */
43