summaryrefslogtreecommitdiff
path: root/Build/source/texk/mendexk
diff options
context:
space:
mode:
authorTakuji Tanaka <ttk@t-lab.opal.ne.jp>2021-05-19 08:02:22 +0000
committerTakuji Tanaka <ttk@t-lab.opal.ne.jp>2021-05-19 08:02:22 +0000
commit20a6dacdb8442b72101911b8d239350c799af1c8 (patch)
tree01abe05a166c8a0982a86a0a90d3bc85caf3b60e /Build/source/texk/mendexk
parentd6eddba56d9a1afe3d6a3392bc4dc4ac19b7ea84 (diff)
mendex: ver.0.56, fix bug in reading style file
git-svn-id: svn://tug.org/texlive/trunk@59262 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/mendexk')
-rw-r--r--Build/source/texk/mendexk/ChangeLog9
-rwxr-xr-xBuild/source/texk/mendexk/configure22
-rw-r--r--Build/source/texk/mendexk/configure.ac2
-rw-r--r--Build/source/texk/mendexk/exvar.h36
-rw-r--r--Build/source/texk/mendexk/styfile.c11
-rw-r--r--Build/source/texk/mendexk/var.h34
-rw-r--r--Build/source/texk/mendexk/version.h2
7 files changed, 68 insertions, 48 deletions
diff --git a/Build/source/texk/mendexk/ChangeLog b/Build/source/texk/mendexk/ChangeLog
index 84673ed9861..403b8a487f8 100644
--- a/Build/source/texk/mendexk/ChangeLog
+++ b/Build/source/texk/mendexk/ChangeLog
@@ -1,3 +1,12 @@
+2021-05-19 TANAKA Takuji <ttk@t-lab.opal.ne.jp>
+
+ * main.c, configure.ac, version.h:
+ Version 3.4 [19-May-2021].
+ * styfile.c, var.h, exvar.h:
+ Fix a bug of reading keywords "setpage_prefix", "setpage_suffix"
+ in style file.
+ More strictly check string length.
+
2021-05-09 Karl Berry <karl@freefriends.org>
* mendex.h (page.attr): use int, not char, since we do signed
diff --git a/Build/source/texk/mendexk/configure b/Build/source/texk/mendexk/configure
index 01cfc10f2f3..46a87f38cdd 100755
--- a/Build/source/texk/mendexk/configure
+++ b/Build/source/texk/mendexk/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mendex (TeX Live) 3.3.
+# Generated by GNU Autoconf 2.69 for mendex (TeX Live) 3.4.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='mendex (TeX Live)'
PACKAGE_TARNAME='mendex--tex-live-'
-PACKAGE_VERSION='3.3'
-PACKAGE_STRING='mendex (TeX Live) 3.3'
+PACKAGE_VERSION='3.4'
+PACKAGE_STRING='mendex (TeX Live) 3.4'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''
@@ -1329,7 +1329,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures mendex (TeX Live) 3.3 to adapt to many kinds of systems.
+\`configure' configures mendex (TeX Live) 3.4 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1400,7 +1400,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mendex (TeX Live) 3.3:";;
+ short | recursive ) echo "Configuration of mendex (TeX Live) 3.4:";;
esac
cat <<\_ACEOF
@@ -1521,7 +1521,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-mendex (TeX Live) configure 3.3
+mendex (TeX Live) configure 3.4
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2173,7 +2173,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mendex (TeX Live) $as_me 3.3, which was
+It was created by mendex (TeX Live) $as_me 3.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -7855,7 +7855,7 @@ fi
# Define the identity of the package.
PACKAGE='mendex--tex-live-'
- VERSION='3.3'
+ VERSION='3.4'
# Some tools Automake needs.
@@ -13907,7 +13907,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-mendex (TeX Live) config.lt 3.3
+mendex (TeX Live) config.lt 3.4
configured by $0, generated by GNU Autoconf 2.69.
Copyright (C) 2011 Free Software Foundation, Inc.
@@ -15516,7 +15516,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mendex (TeX Live) $as_me 3.3, which was
+This file was extended by mendex (TeX Live) $as_me 3.4, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15582,7 +15582,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mendex (TeX Live) config.status 3.3
+mendex (TeX Live) config.status 3.4
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/texk/mendexk/configure.ac b/Build/source/texk/mendexk/configure.ac
index d6ce8301d47..2a8992b345c 100644
--- a/Build/source/texk/mendexk/configure.ac
+++ b/Build/source/texk/mendexk/configure.ac
@@ -8,7 +8,7 @@ dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
-AC_INIT([mendex (TeX Live)], [3.3])
+AC_INIT([mendex (TeX Live)], [3.4])
AC_PREREQ([2.63])
AC_CONFIG_SRCDIR([main.c])
AC_CONFIG_AUX_DIR([../../build-aux])
diff --git a/Build/source/texk/mendexk/exvar.h b/Build/source/texk/mendexk/exvar.h
index a30a77220b4..78720e4dd6b 100644
--- a/Build/source/texk/mendexk/exvar.h
+++ b/Build/source/texk/mendexk/exvar.h
@@ -6,29 +6,31 @@ extern int warn,scount,pattr[3];
extern struct index *ind;
-extern char keyword[2048];
+#define STYBUFSIZE 2048
+
+extern char keyword[];
extern char arg_open,arg_close;
extern char range_open,range_close;
extern char level,actual,encap,quote,escape;
-extern char preamble[2048],postamble[2048];
-extern char setpage_prefix[2048],setpage_suffix[2048];
-extern char group_skip[2048];
-extern char lethead_prefix[2048],lethead_suffix[2048];
+extern char preamble[],postamble[];
+extern char setpage_prefix[],setpage_suffix[];
+extern char group_skip[];
+extern char lethead_prefix[],lethead_suffix[];
extern int lethead_flag;
-extern char item_0[2048],item_1[2048],item_2[2048];
-extern char item_01[2048],item_x1[2048],item_12[2048],item_x2[2048];
-extern char delim_0[2048],delim_1[2048],delim_2[2048],delim_n[2048],delim_r[2048],delim_t[2048];
-extern char suffix_2p[2048],suffix_3p[2048],suffix_mp[2048];
-extern char encap_prefix[2048],encap_infix[2048],encap_suffix[2048];
+extern char item_0[],item_1[],item_2[];
+extern char item_01[],item_x1[],item_12[],item_x2[];
+extern char delim_0[],delim_1[],delim_2[],delim_n[],delim_r[],delim_t[];
+extern char suffix_2p[],suffix_3p[],suffix_mp[];
+extern char encap_prefix[],encap_infix[],encap_suffix[];
extern int line_max;
-extern char indent_space[2048];
+extern char indent_space[];
extern int indent_length;
extern int priority;
-extern char symbol[2048];
-extern char symhead_positive[2048],symhead_negative[2048];
-extern char numhead_positive[2048],numhead_negative[2048];
+extern char symbol[];
+extern char symhead_positive[],symhead_negative[];
+extern char numhead_positive[],numhead_negative[];
extern int symbol_flag;
extern int letter_head;
-extern char atama[2048];
-extern char page_compositor[2048],page_precedence[2048];
-extern char character_order[2048];
+extern char atama[];
+extern char page_compositor[],page_precedence[];
+extern char character_order[];
diff --git a/Build/source/texk/mendexk/styfile.c b/Build/source/texk/mendexk/styfile.c
index e35256c2e29..387182f3a12 100644
--- a/Build/source/texk/mendexk/styfile.c
+++ b/Build/source/texk/mendexk/styfile.c
@@ -63,6 +63,8 @@ void styread(const char *filename)
if (getparachar(buff,"escape",&escape)) continue;
if (getparam(buff,"preamble",preamble)) continue;
if (getparam(buff,"postamble",postamble)) continue;
+ if (getparam(buff,"setpage_prefix",setpage_prefix)) continue;
+ if (getparam(buff,"setpage_suffix",setpage_suffix)) continue;
if (getparam(buff,"group_skip",group_skip)) continue;
if (getparam(buff,"lethead_prefix",lethead_prefix)) continue;
if (getparam(buff,"heading_prefix",lethead_prefix)) continue;
@@ -90,7 +92,6 @@ void styread(const char *filename)
if (getparam(buff,"item_0",item_0)) continue;
if (getparam(buff,"item_1",item_1)) continue;
if (getparam(buff,"item_2",item_2)) continue;
- if (getparam(buff,"item_2",item_2)) continue;
if (getparam(buff,"item_01",item_01)) continue;
if (getparam(buff,"item_x1",item_x1)) continue;
if (getparam(buff,"item_12",item_12)) continue;
@@ -143,6 +144,10 @@ static void convline(char *buff1, int start, char *buff2)
int i,j,cc;
for (i=start,j=cc=0;;i++) {
+ if (j==STYBUFSIZE-1) {
+ buff2[j]='\0';
+ break;
+ }
if (buff1[i]=='\"') {
if (cc==0) {
cc=1;
@@ -170,6 +175,10 @@ static void convline(char *buff1, int start, char *buff2)
verb_printf(efp,"\nWarning: Illegal input of lead byte 0x%x in UTF-8.", (unsigned char)buff1[i]);
continue;
}
+ else if (j+len>STYBUFSIZE-1) {
+ buff2[j]='\0';
+ break;
+ }
while(len--) {
buff2[j++]=buff1[i++];
}
diff --git a/Build/source/texk/mendexk/var.h b/Build/source/texk/mendexk/var.h
index 9565dd791d0..1d6a475edee 100644
--- a/Build/source/texk/mendexk/var.h
+++ b/Build/source/texk/mendexk/var.h
@@ -9,29 +9,29 @@ int warn=0,scount=0,pattr[3]={0,0,0};
struct index *ind;
-char keyword[2048]={"\\indexentry"};
+char keyword[STYBUFSIZE]={"\\indexentry"};
char arg_open='{',arg_close='}';
char range_open='(',range_close=')';
char level='!',actual='@',encap='|',quote='\"',escape='\\';
-char preamble[2048]={"\\begin{theindex}\n"},postamble[2048]={"\n\n\\end{theindex}\n"};
-char setpage_prefix[2048]={"\n \\setcounter{page}{"},setpage_suffix[2048]={"}\n"};
-char group_skip[2048]={"\n\n \\indexspace\n"};
-char lethead_prefix[2048]={""},lethead_suffix[2048]={""};
+char preamble[STYBUFSIZE]={"\\begin{theindex}\n"},postamble[STYBUFSIZE]={"\n\n\\end{theindex}\n"};
+char setpage_prefix[STYBUFSIZE]={"\n \\setcounter{page}{"},setpage_suffix[STYBUFSIZE]={"}\n"};
+char group_skip[STYBUFSIZE]={"\n\n \\indexspace\n"};
+char lethead_prefix[STYBUFSIZE]={""},lethead_suffix[STYBUFSIZE]={""};
int lethead_flag=0;
-char item_0[2048]={"\n \\item "},item_1[2048]={"\n \\subitem "},item_2[2048]={"\n \\subsubitem "};
-char item_01[2048]={"\n \\subitem "},item_x1[2048]={"\n \\subitem "},item_12[2048]={"\n \\subsubitem "},item_x2[2048]={"\n \\subsubitem "};
-char delim_0[2048]={", "},delim_1[2048]={", "},delim_2[2048]={", "},delim_n[2048]={", "},delim_r[2048]={"--"},delim_t[2048]={""};
-char suffix_2p[2048]={""},suffix_3p[2048]={""},suffix_mp[2048]={""};
-char encap_prefix[2048]={"\\"},encap_infix[2048]={"{"},encap_suffix[2048]={"}"};
+char item_0[STYBUFSIZE]={"\n \\item "},item_1[STYBUFSIZE]={"\n \\subitem "},item_2[STYBUFSIZE]={"\n \\subsubitem "};
+char item_01[STYBUFSIZE]={"\n \\subitem "},item_x1[STYBUFSIZE]={"\n \\subitem "},item_12[STYBUFSIZE]={"\n \\subsubitem "},item_x2[STYBUFSIZE]={"\n \\subsubitem "};
+char delim_0[STYBUFSIZE]={", "},delim_1[STYBUFSIZE]={", "},delim_2[STYBUFSIZE]={", "},delim_n[STYBUFSIZE]={", "},delim_r[STYBUFSIZE]={"--"},delim_t[STYBUFSIZE]={""};
+char suffix_2p[STYBUFSIZE]={""},suffix_3p[STYBUFSIZE]={""},suffix_mp[STYBUFSIZE]={""};
+char encap_prefix[STYBUFSIZE]={"\\"},encap_infix[STYBUFSIZE]={"{"},encap_suffix[STYBUFSIZE]={"}"};
int line_max=72;
-char indent_space[2048]={"\t\t"};
+char indent_space[STYBUFSIZE]={"\t\t"};
int indent_length=16;
int priority=0;
-char symbol[2048]={""};
-char symhead_positive[2048]={"Symbols"},symhead_negative[2048]={"symbols"};
-char numhead_positive[2048]={"Numbers"},numhead_negative[2048]={"numbers"};
+char symbol[STYBUFSIZE]={""};
+char symhead_positive[STYBUFSIZE]={"Symbols"},symhead_negative[STYBUFSIZE]={"symbols"};
+char numhead_positive[STYBUFSIZE]={"Numbers"},numhead_negative[STYBUFSIZE]={"numbers"};
int symbol_flag=1;
int letter_head=1;
-char atama[2048];
-char page_compositor[2048]={"-"},page_precedence[2048]={"rnaRA"};
-char character_order[2048]={"SNEJ"};
+char atama[STYBUFSIZE];
+char page_compositor[STYBUFSIZE]={"-"},page_precedence[STYBUFSIZE]={"rnaRA"};
+char character_order[STYBUFSIZE]={"SNEJ"};
diff --git a/Build/source/texk/mendexk/version.h b/Build/source/texk/mendexk/version.h
index 64a0419d5af..1be36707286 100644
--- a/Build/source/texk/mendexk/version.h
+++ b/Build/source/texk/mendexk/version.h
@@ -1,2 +1,2 @@
-#define VERSION "version " PACKAGE_VERSION " [21-Mar-2021]"
+#define VERSION "version " PACKAGE_VERSION " [19-May-2021]"
#define BUG_ADDRESS "issue@texjp.org"