]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: In language awk, avoid stack overflow.
authorBruno Haible <bruno@clisp.org>
Wed, 8 Mar 2023 19:40:35 +0000 (20:40 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 9 Mar 2023 10:40:25 +0000 (11:40 +0100)
commitcd298b41029697bd50906b1c3dded2501fb0f8b6
treea793378f257ddb6b7d29e77768765ec75443a04e
parentbcd08ef4de638f94b511d8365cc178e7180188a9
xgettext: In language awk, avoid stack overflow.

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