app-i18n/canna: fix build with -Werror=format-security
authorAkinori Hattori <hattya@gentoo.org>
Sat, 8 Jul 2017 08:54:52 +0000 (17:54 +0900)
committerAkinori Hattori <hattya@gentoo.org>
Sat, 8 Jul 2017 09:13:45 +0000 (18:13 +0900)
Gentoo-Bug: 521054

Package-Manager: Portage-2.3.6, Repoman-2.3.1

app-i18n/canna/canna-3.7_p3-r1.ebuild
app-i18n/canna/canna-3.7_p3-r2.ebuild
app-i18n/canna/canna-3.7_p3-r3.ebuild
app-i18n/canna/files/canna-Wformat-security.patch [new file with mode: 0644]

index 97dee1123ab460ab65964dbbe93ad2663acd87f3..6a04c297b980c539b7e5dd4ffcb962f7e6afd937 100644 (file)
@@ -26,6 +26,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-kpdef.patch
        "${FILESDIR}"/${PN}-posix-sort.patch
        "${FILESDIR}"/${PN}-Wformat.patch
+       "${FILESDIR}"/${PN}-Wformat-security.patch
 )
 DOCS="*CHANGES* ChangeLog INSTALL* README* RKCCONF* WHATIS*"
 
index 2236655f62275adfcc11121a1fb2bf122b83933f..f6c43bc73d8e79908c0d0715089632b02069407e 100644 (file)
@@ -31,6 +31,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-kpdef.patch
        "${FILESDIR}"/${PN}-posix-sort.patch
        "${FILESDIR}"/${PN}-Wformat.patch
+       "${FILESDIR}"/${PN}-Wformat-security.patch
 )
 DOCS="*CHANGES* ChangeLog INSTALL* README* RKCCONF* WHATIS*"
 
index d794f10e8ed158b4b6bdc78556f2e9363b4ef320..bb324c8e8ea5e4886796edd39d6a6843cac34738 100644 (file)
@@ -37,6 +37,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-kpdef.patch
        "${FILESDIR}"/${PN}-posix-sort.patch
        "${FILESDIR}"/${PN}-Wformat.patch
+       "${FILESDIR}"/${PN}-Wformat-security.patch
 )
 DOCS="*CHANGES* ChangeLog INSTALL* README* RKCCONF* WHATIS*"
 
diff --git a/app-i18n/canna/files/canna-Wformat-security.patch b/app-i18n/canna/files/canna-Wformat-security.patch
new file mode 100644 (file)
index 0000000..c83552b
--- /dev/null
@@ -0,0 +1,199 @@
+--- a/cmd/catdic/can.c
++++ b/cmd/catdic/can.c
+@@ -1236,7 +1236,7 @@
+       break;
+       default:
+       if (init[0] == '/') {
+-          (void)fprintf(stderr,msg_abnl);
++          (void)fprintf(stderr,"%s",msg_abnl);
+       } else {
+           (void)fprintf(stderr,msg_abnls,init);
+       }
+@@ -1297,11 +1297,11 @@
+ 
+     if ( opt_fq ) {
+       if ( opt_s ) {
+-        (void) fprintf(stderr,msg_sfq);
++        (void) fprintf(stderr,"%s",msg_sfq);
+         exit(ERR_VALUE) ;
+       }  
+       if ( opt_l || opt_std ) {
+-        (void) fprintf(stderr,msg_l);
++        (void) fprintf(stderr,"%s",msg_l);
+         exit(ERR_VALUE) ;
+       }
+       mode = mode | PL_DIC ;
+@@ -1491,7 +1491,7 @@
+     break;
+   default:
+     if(init[0] == '/') {
+-      fprintf(stderr,msg_abnl );
++      fprintf(stderr,"%s",msg_abnl );
+     }
+     else {
+       fprintf(stderr,msg_abnls,init);
+--- a/cmd/catdic/rutil.c
++++ b/cmd/catdic/rutil.c
+@@ -271,7 +271,7 @@
+        "Dictionary \"%s\" does not exist.\n"), dicname);
+     break;
+   case NOTALC :
+-    (void)fprintf(stderr, msg_mem);
++    (void)fprintf(stderr, "%s", msg_mem);
+     break;
+   case BADF :
+     (void)fprintf(stderr, gettxt("cannacmd:196",
+@@ -297,7 +297,7 @@
+       (void)fprintf(stderr,msg_abnls,init);
+     }
+     else {
+-      (void)fprintf(stderr,msg_abnl);
++      (void)fprintf(stderr,"%s",msg_abnl);
+     }
+     break;
+   }
+@@ -321,7 +321,7 @@
+       (void)fprintf(stderr, msg_abnls, init);
+     }
+     else {
+-      (void)fprintf(stderr, msg_abnl);
++      (void)fprintf(stderr, "%s", msg_abnl);
+     }
+     ret = -1;
+     return ret;
+@@ -332,13 +332,13 @@
+         (void)fprintf(stderr, msg_mnts, init);
+       }
+       else {
+-        (void)fprintf(stderr, msg_mnt);
++        (void)fprintf(stderr, "%s", msg_mnt);
+       }
+       ret = -1;
+       return ret;
+     }
+     if ((mode & PL_DIC) == PL_DIC ) {
+-      (void)fprintf(stderr,msg_fq);
++      (void)fprintf(stderr,"%s",msg_fq);
+       ret = -1 ;
+       return ret ;
+     }
+@@ -359,7 +359,7 @@
+     ret = 0;
+     break;
+   case NOTALC :
+-    (void)fprintf(stderr, msg_mem);
++    (void)fprintf(stderr, "%s", msg_mem);
+     ret = -1;
+     break;
+   case BADF :
+@@ -421,7 +421,7 @@
+     ret = -1;
+     break;
+   case BADCONT :
+-    (void)fprintf(stderr,msg_cnt);
++    (void)fprintf(stderr,"%s",msg_cnt);
+     ret = -1;
+     break;
+   default:
+@@ -429,7 +429,7 @@
+       (void)fprintf(stderr, msg_abnls, init);
+     }
+     else {
+-      (void)fprintf(stderr, msg_abnl);
++      (void)fprintf(stderr, "%s", msg_abnl);
+     }
+     exit(ERR_VALUE);
+     break;
+@@ -448,7 +448,7 @@
+     ret = 0;
+     break;
+   case NOTALC :
+-    (void)fprintf(stderr, msg_mem);
++    (void)fprintf(stderr, "%s", msg_mem);
+     ret = -1;
+     break;
+   case BADF :
+@@ -509,11 +509,11 @@
+     ret = -1;
+     break;
+   case BADARG :
+-    (void)fprintf(stderr,msg_fq);
++    (void)fprintf(stderr,"%s",msg_fq);
+     ret = -1;
+     break;
+   case BADCONT :
+-    (void)fprintf(stderr,msg_cnt);
++    (void)fprintf(stderr,"%s",msg_cnt);
+     ret = -1;
+     break;
+   case NOENT  :   /* 91.12.03 */
+@@ -526,7 +526,7 @@
+       (void)fprintf(stderr, msg_abnls, init);
+     }
+     else {
+-      (void)fprintf(stderr, msg_abnl);
++      (void)fprintf(stderr, "%s", msg_abnl);
+     }
+     exit(ERR_VALUE);
+     break;
+@@ -556,7 +556,7 @@
+       (void)fprintf(stderr, msg_abnls,init);
+     }
+     else {
+-      (void)fprintf(stderr, msg_abnl);
++      (void)fprintf(stderr, "%s", msg_abnl);
+     }
+     ret = -1;
+     return ret;
+@@ -567,13 +567,13 @@
+       (void)fprintf(stderr, msg_mnts, init);
+       }
+       else {
+-        (void)fprintf(stderr, msg_mnt);
++        (void)fprintf(stderr, "%s", msg_mnt);
+       }
+       ret = -1;
+       return ret;
+     }
+     if ((mode & PL_DIC) == PL_DIC ) {
+-      (void)fprintf(stderr, msg_fq);
++      (void)fprintf(stderr, "%s", msg_fq);
+       ret = -1 ;
+       return ret ;
+     }
+@@ -608,7 +608,7 @@
+     ret = -2;   /* 93.03.03 */
+     break;
+   case BADCONT :
+-    (void)fprintf(stderr, msg_cnt);
++    (void)fprintf(stderr, "%s", msg_cnt);
+     ret = -1;
+     break;
+   default:
+@@ -616,7 +616,7 @@
+       (void)fprintf(stderr, msg_abnls, init);
+     }
+     else {
+-      (void)fprintf(stderr, msg_abnl);
++      (void)fprintf(stderr, "%s", msg_abnl);
+     }
+     ret = -1;
+     break;
+@@ -651,7 +651,7 @@
+     ret = -2;   /* 93.03.03 */
+     break;
+   case BADCONT :
+-    (void)fprintf(stderr, msg_cnt);
++    (void)fprintf(stderr, "%s", msg_cnt);
+     ret = -1;
+     break;
+   default:
+@@ -659,7 +659,7 @@
+       (void)fprintf(stderr, msg_abnls, init);
+     }
+     else {
+-      (void)fprintf(stderr, msg_abnl);
++      (void)fprintf(stderr, "%s", msg_abnl);
+     }
+     ret = -1;
+     break;