]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
xgettext: In language Tcl, avoid stack overflow.
authorBruno Haible <bruno@clisp.org>
Thu, 9 Mar 2023 10:34:41 +0000 (11:34 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 9 Mar 2023 10:41:04 +0000 (11:41 +0100)
* gettext-tools/src/x-tcl.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(bracket_nesting_depth, brace_nesting_depth): New variables.
(accumulate_word, read_word): Increase and check bracket_nesting_depth or
brace_nesting_depth before calling read_command_list recursively.
(extract_tcl): Initialize bracket_nesting_depth and brace_nesting_depth.
* gettext-tools/tests/xgettext-tcl-stackovfl-1: New file.
* gettext-tools/tests/xgettext-tcl-stackovfl-2: New file.
* gettext-tools/tests/xgettext-tcl-stackovfl-3: New file.
* gettext-tools/tests/xgettext-tcl-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.

gettext-tools/src/x-tcl.c
gettext-tools/tests/Makefile.am
gettext-tools/tests/xgettext-tcl-stackovfl-1 [new file with mode: 0755]
gettext-tools/tests/xgettext-tcl-stackovfl-2 [new file with mode: 0755]
gettext-tools/tests/xgettext-tcl-stackovfl-3 [new file with mode: 0755]
gettext-tools/tests/xgettext-tcl-stackovfl-4 [new file with mode: 0755]

index f7f7846847df8fa0b14b4fe71545a8711f274a53..e3df627792472df815036d52a1c225bcf66ddfa9 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext Tcl backend.
-   Copyright (C) 2002-2003, 2005-2009, 2013, 2018-2020 Free Software Foundation, Inc.
+   Copyright (C) 2002-2003, 2005-2009, 2013, 2018-2023 Free Software Foundation, Inc.
 
    This file was written by Bruno Haible <haible@clisp.cons.org>, 2002.
 
@@ -42,6 +42,7 @@
 #include "xg-arglist-parser.h"
 #include "xg-message.h"
 #include "error.h"
+#include "error-progname.h"
 #include "xalloc.h"
 #include "mem-hash-map.h"
 #include "c-ctype.h"
@@ -462,6 +463,14 @@ string_of_word (const struct word *wp)
 static flag_context_list_table_ty *flag_context_list_table;
 
 
+/* Maximum supported nesting depth.  */
+#define MAX_NESTING_DEPTH 1000
+
+/* Current nesting depths.  */
+static int bracket_nesting_depth;
+static int brace_nesting_depth;
+
+
 /* Read an escape sequence.  The value is an ISO-8859-1 character (in the
    range 0x00..0xff) or a Unicode character (in the range 0x0000..0xffff).  */
 static int
@@ -678,7 +687,14 @@ accumulate_word (struct word *wp, enum terminator looking_for,
         }
       else if (c == '[')
         {
+          if (++bracket_nesting_depth > MAX_NESTING_DEPTH)
+            {
+              error_with_progname = false;
+              error (EXIT_FAILURE, 0, _("%s:%d: error: too many open brackets"),
+                     logical_file_name, line_number);
+            }
           read_command_list (']', context);
+          bracket_nesting_depth--;
           wp->type = t_other;
         }
       else if (c == '\\')
@@ -770,7 +786,14 @@ read_word (struct word *wp, int looking_for, flag_context_ty context)
       previous_depth = phase2_push () - 1;
 
       /* Interpret it as a command list.  */
+      if (++brace_nesting_depth > MAX_NESTING_DEPTH)
+        {
+          error_with_progname = false;
+          error (EXIT_FAILURE, 0, _("%s:%d: error: too many open braces"),
+                 logical_file_name, line_number);
+        }
       terminator = read_command_list ('\0', null_context);
+      brace_nesting_depth--;
 
       if (terminator == t_brace)
         phase2_pop (previous_depth);
@@ -997,6 +1020,8 @@ extract_tcl (FILE *f,
   last_non_comment_line = -1;
 
   flag_context_list_table = flag_table;
+  bracket_nesting_depth = 0;
+  brace_nesting_depth = 0;
 
   init_keywords ();
 
index 1cad63813be6c86a14e70c0c08941956327e2c99..3e30dc3e78d88e25ce552fc097d4f6ad06337ef0 100644 (file)
@@ -148,6 +148,8 @@ TESTS = gettext-1 gettext-2 \
        xgettext-smalltalk-1 xgettext-smalltalk-2 \
        xgettext-stringtable-1 \
        xgettext-tcl-1 xgettext-tcl-2 xgettext-tcl-3 xgettext-tcl-4 \
+       xgettext-tcl-stackovfl-1 xgettext-tcl-stackovfl-2 \
+       xgettext-tcl-stackovfl-3 xgettext-tcl-stackovfl-4 \
        xgettext-vala-1 xgettext-vala-2 \
        xgettext-vala-stackovfl-1 xgettext-vala-stackovfl-2 \
        xgettext-ycp-1 xgettext-ycp-2 xgettext-ycp-3 xgettext-ycp-4 \
diff --git a/gettext-tools/tests/xgettext-tcl-stackovfl-1 b/gettext-tools/tests/xgettext-tcl-stackovfl-1
new file mode 100755 (executable)
index 0000000..95005d6
--- /dev/null
@@ -0,0 +1,63 @@
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test Tcl support: stack overflow prevented by nesting depth check.
+
+cat <<EOF > xg-t-so-1.tcl
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[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]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+EOF
+
+: ${XGETTEXT=xgettext}
+${XGETTEXT} -k_ --omit-header --no-location -d xg-t-so-1.tmp xg-t-so-1.tcl || Exit 1
+LC_ALL=C tr -d '\r' < xg-t-so-1.tmp.po > xg-t-so-1.po || Exit 1
+
+cat <<EOF > xg-t-so-1.ok
+msgid "Hello!"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-t-so-1.ok xg-t-so-1.po
+result=$?
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-tcl-stackovfl-2 b/gettext-tools/tests/xgettext-tcl-stackovfl-2
new file mode 100755 (executable)
index 0000000..c41ae7f
--- /dev/null
@@ -0,0 +1,56 @@
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test Tcl support: stack overflow prevented by nesting depth check.
+
+cat <<EOF > xg-t-so-2.tcl
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[
+[[[[[[[[[[[[[[[[[[[[[[[[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]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
+EOF
+
+: ${XGETTEXT=xgettext}
+${XGETTEXT} -k_ --omit-header --no-location -d xg-t-so-2.tmp xg-t-so-2.tcl 2>xg-t-so-2.err
+result=$?
+cat xg-t-so-2.err
+test $result = 1 || Exit 1
+
+exit 0
diff --git a/gettext-tools/tests/xgettext-tcl-stackovfl-3 b/gettext-tools/tests/xgettext-tcl-stackovfl-3
new file mode 100755 (executable)
index 0000000..2afa014
--- /dev/null
@@ -0,0 +1,63 @@
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test Tcl support: stack overflow prevented by nesting depth check.
+
+cat <<EOF > xg-t-so-3.tcl
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{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}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}
+EOF
+
+: ${XGETTEXT=xgettext}
+${XGETTEXT} -k_ --omit-header --no-location -d xg-t-so-3.tmp xg-t-so-3.tcl || Exit 1
+LC_ALL=C tr -d '\r' < xg-t-so-3.tmp.po > xg-t-so-3.po || Exit 1
+
+cat <<EOF > xg-t-so-3.ok
+msgid "Hello!"
+msgstr ""
+EOF
+
+: ${DIFF=diff}
+${DIFF} xg-t-so-3.ok xg-t-so-3.po
+result=$?
+
+exit $result
diff --git a/gettext-tools/tests/xgettext-tcl-stackovfl-4 b/gettext-tools/tests/xgettext-tcl-stackovfl-4
new file mode 100755 (executable)
index 0000000..34a37ab
--- /dev/null
@@ -0,0 +1,58 @@
+#! /bin/sh
+. "${srcdir=.}/init.sh"; path_prepend_ . ../src
+
+# Test Tcl support: stack overflow prevented by nesting depth check.
+
+cat <<EOF > xg-t-so-4.tcl
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{
+{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{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