]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: In language EmacsLisp, avoid stack overflow, part 1.
authorBruno Haible <bruno@clisp.org>
Tue, 7 Mar 2023 20:46:17 +0000 (21:46 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 9 Mar 2023 10:40:13 +0000 (11:40 +0100)
commit00dc0785631a842c49c1f740fd482bec0a39fa03
treead62884321bbc8c1405d7fd6184b2d7824fb632c
parent8a5b80ae39720ffe41da206ddfa62c5fcc2f3777
xgettext: In language EmacsLisp, avoid stack overflow, part 1.

* gettext-tools/src/x-elisp.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_elisp): Initialize nesting_depth.
* gettext-tools/tests/xgettext-elisp-stackovfl-1: New file.
* gettext-tools/tests/xgettext-elisp-stackovfl-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
gettext-tools/src/x-elisp.c
gettext-tools/tests/Makefile.am
gettext-tools/tests/xgettext-elisp-stackovfl-1 [new file with mode: 0755]
gettext-tools/tests/xgettext-elisp-stackovfl-2 [new file with mode: 0755]