[Canna] - More format-security fixes (#1037008)
Jaromír Cápík
jcapik at fedoraproject.org
Wed Apr 16 15:44:28 UTC 2014
commit 5bdc28d673e4b729062aaa1525d20dd8ba86c5f1
Author: Jaromir Capik <jcapik at redhat.com>
Date: Wed Apr 16 17:43:33 2014 +0200
- More format-security fixes (#1037008)
Canna-3.7p3-format-security.patch | 166 +++++++++++++++++++++++++++++++++++++
Canna.spec | 9 ++-
2 files changed, 174 insertions(+), 1 deletions(-)
---
diff --git a/Canna-3.7p3-format-security.patch b/Canna-3.7p3-format-security.patch
new file mode 100644
index 0000000..0637e70
--- /dev/null
+++ b/Canna-3.7p3-format-security.patch
@@ -0,0 +1,166 @@
+diff -Naur Canna-3.7p3.orig/Canna37p3/cmd/catdic/rutil.c Canna-3.7p3/Canna37p3/cmd/catdic/rutil.c
+--- Canna-3.7p3.orig/Canna37p3/cmd/catdic/rutil.c 2003-12-27 18:15:21.000000000 +0100
++++ Canna-3.7p3/Canna37p3/cmd/catdic/rutil.c 2014-04-16 17:28:26.640000000 +0200
+@@ -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;
diff --git a/Canna.spec b/Canna.spec
index 9ba9a7f..ed06349 100644
--- a/Canna.spec
+++ b/Canna.spec
@@ -10,7 +10,7 @@
Summary: A Japanese character set input system.
Name: Canna
Version: 3.7p3
-Release: 41%{?dist}
+Release: 42%{?dist}
# lib/RKindep/cksum.c is licensed under 4-clause BSD, otherwise MIT.
License: MIT and BSD with advertising
Group: System Environment/Libraries
@@ -50,6 +50,9 @@ Patch43: Canna-3.7p3-fix-gcc4-warning.patch
Patch44: Canna-3.7p3-no-strip.patch
Patch45: %{name}-3.7p3-fix-format.patch
Patch50: %{name}-aarch64.patch
+# Patches not upstream (yet)
+Patch99: %{name}-3.7p3-format-security.patch
+
Requires(pre): shadow-utils
Requires(post): /bin/grep /etc/services /sbin/chkconfig %{__chown} systemd-units
@@ -110,6 +113,7 @@ cd %{cannadir}
%patch45 -p1 -b .format
cd ..
%patch50 -p1 -b .aarch64
+%patch99 -p1 -b .fmt-sec
for file in %{cannadir}/{cmd/mkromdic/mkromdic.man,lib/RK/RkIntro.man}; do
iconv -f euc-jp -t utf-8 < "$file" > "${file}_"
@@ -336,6 +340,9 @@ fi
%{_libdir}/libcanna16.so.*
%changelog
+* Wed Apr 16 2014 Jaromir Capik <jcapik at redhat.com> - 3.7p3-42
+- More format-security fixes (#1037008)
+
* Tue Dec 10 2013 Akira TAGOH <tagoh at redhat.com> - 3.7p3-41
- Fix an error when building with -Werror=format-security. (#1037008)
More information about the scm-commits
mailing list