]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: In language YCP, avoid stack overflow.
authorBruno Haible <bruno@clisp.org>
Thu, 9 Mar 2023 21:30:17 +0000 (22:30 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 9 Mar 2023 21:30:17 +0000 (22:30 +0100)
commite62ed464dca2c06eec7945375372b7e4dfdeeb03
tree97c6e93acd44c727117e2d719374aec67b2b7e14
parent423572741811037a7a6f1127221aaf1fe6842aff
xgettext: In language YCP, avoid stack overflow.

* gettext-tools/src/x-ycp.c: Include error-progname.h.
(MAX_NESTING_DEPTH): New macro.
(nesting_depth): New variable.
(extract_parenthesized): Increase and check nesting_depth before calling
extract_parenthesized recursively.
(extract_ycp): Initialize nesting_depth.
* gettext-tools/tests/xgettext-ycp-stackovfl-1: New file.
* gettext-tools/tests/xgettext-ycp-stackovfl-2: New file.
* gettext-tools/tests/xgettext-ycp-stackovfl-3: New file.
* gettext-tools/tests/xgettext-ycp-stackovfl-4: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add them.
gettext-tools/src/x-ycp.c
gettext-tools/tests/Makefile.am
gettext-tools/tests/xgettext-ycp-stackovfl-1 [new file with mode: 0755]
gettext-tools/tests/xgettext-ycp-stackovfl-2 [new file with mode: 0755]
gettext-tools/tests/xgettext-ycp-stackovfl-3 [new file with mode: 0755]
gettext-tools/tests/xgettext-ycp-stackovfl-4 [new file with mode: 0755]