app-i18n/canna: fix buffer overflow
authorAkinori Hattori <hattya@gentoo.org>
Sat, 8 Jul 2017 08:59:14 +0000 (17:59 +0900)
committerAkinori Hattori <hattya@gentoo.org>
Sat, 8 Jul 2017 09:13:45 +0000 (18:13 +0900)
Gentoo-Bug: 341185

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-overflow.patch [new file with mode: 0644]

index 6a04c297b980c539b7e5dd4ffcb962f7e6afd937..e38caaff6fb53c98eef5bdcdb58d37d973985d3e 100644 (file)
@@ -24,6 +24,7 @@ S="${WORKDIR}/${MY_P}"
 PATCHES=(
        "${FILESDIR}"/${PN}-gentoo.patch
        "${FILESDIR}"/${PN}-kpdef.patch
+       "${FILESDIR}"/${PN}-overflow.patch
        "${FILESDIR}"/${PN}-posix-sort.patch
        "${FILESDIR}"/${PN}-Wformat.patch
        "${FILESDIR}"/${PN}-Wformat-security.patch
index f6c43bc73d8e79908c0d0715089632b02069407e..a06d55f21d766c26958e3f06f6bdcc7b317d6b95 100644 (file)
@@ -29,6 +29,7 @@ S="${WORKDIR}/${MY_P}"
 PATCHES=(
        "${FILESDIR}"/${PN}-gentoo.patch
        "${FILESDIR}"/${PN}-kpdef.patch
+       "${FILESDIR}"/${PN}-overflow.patch
        "${FILESDIR}"/${PN}-posix-sort.patch
        "${FILESDIR}"/${PN}-Wformat.patch
        "${FILESDIR}"/${PN}-Wformat-security.patch
index bb324c8e8ea5e4886796edd39d6a6843cac34738..8dbf091e2dd89d4a4e49d52e89dd2f48522cfce9 100644 (file)
@@ -35,6 +35,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-gentoo.patch
        "${FILESDIR}"/${PN}-canuum.patch
        "${FILESDIR}"/${PN}-kpdef.patch
+       "${FILESDIR}"/${PN}-overflow.patch
        "${FILESDIR}"/${PN}-posix-sort.patch
        "${FILESDIR}"/${PN}-Wformat.patch
        "${FILESDIR}"/${PN}-Wformat-security.patch
diff --git a/app-i18n/canna/files/canna-overflow.patch b/app-i18n/canna/files/canna-overflow.patch
new file mode 100644 (file)
index 0000000..ef3b6ad
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/cmd/catdic/rutil.c
++++ b/cmd/catdic/rutil.c
+@@ -384,7 +384,7 @@
+       (void)fprintf(stderr,gettxt("cannacmd:205", 
+     "Specified dictionary \"%s\" already exists. Do you overwrite it ? (y/n)"),
+                     dicname);
+-      fgets(ans,80,stdin);
++      fgets(ans,sizeof(ans),stdin);
+     } else {
+       (void)fprintf(stderr,gettxt("cannacmd:206", 
+           "Specified dictionary \"%s\" already exists."),dicname);
+@@ -474,7 +474,7 @@
+     if (isatty(fileno(stdin)) != 0) {
+       (void)fprintf(stderr,gettxt("cannacmd:216", 
+ "Personal learning file of dictionary \"%s\" exists. Do you overwrite it ? (y/n)"),dicname);
+-      fgets(ans,80,stdin);
++      fgets(ans,sizeof(ans),stdin);
+     } else {
+       (void)fprintf(stderr,gettxt("cannacmd:217", 
+     "Personal learning file of system dictionary \"%s\" already exists."),