]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: In language Lisp, avoid stack overflow.
authorBruno Haible <bruno@clisp.org>
Tue, 7 Mar 2023 16:16:34 +0000 (17:16 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 9 Mar 2023 10:38:12 +0000 (11:38 +0100)
commit8a5b80ae39720ffe41da206ddfa62c5fcc2f3777
tree580eb5400e13f50631d05dfb750af53da173de7c
parent25109a5f967b85c16c17616154f87ab4175b42cc
xgettext: In language Lisp, avoid stack overflow.

* gettext-tools/src/x-lisp.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(read_object): Increase nesting_depth before calling read_object recursively.
Check nesting_depth.
(extract_lisp): Initialize nesting_depth.
* gettext-tools/tests/xgettext-lisp-stackovfl-1: New file.
* gettext-tools/tests/xgettext-lisp-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
gettext-tools/src/x-lisp.c
gettext-tools/tests/Makefile.am
gettext-tools/tests/xgettext-lisp-stackovfl-1 [new file with mode: 0755]
gettext-tools/tests/xgettext-lisp-stackovfl-2 [new file with mode: 0755]