]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: In language librep, avoid stack overflow.
authorBruno Haible <bruno@clisp.org>
Tue, 7 Mar 2023 23:02:07 +0000 (00:02 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 9 Mar 2023 10:40:25 +0000 (11:40 +0100)
commit793f539ef3201392ae5e7649f369f97285fbbfe4
treeeb52fa4371f004384e00082c5dbba6c4672c4d83
parent85c8fb4d0868898e8d96c8c7c8aaf3001874ee01
xgettext: In language librep, avoid stack overflow.

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