]> git.ipfire.org Git - thirdparty/gettext.git/commit
xgettext: Fix crash with *.po file input
authorDaiki Ueno <ueno@gnu.org>
Thu, 15 Sep 2016 11:57:24 +0000 (13:57 +0200)
committerDaiki Ueno <ueno@gnu.org>
Thu, 15 Sep 2016 12:01:43 +0000 (14:01 +0200)
commitdce3a16e5e9368245735e29bf498dcd5e3e474a4
treef2d522ba8b9e3a83a2e7f2bc91bc59be1a83ac04
parent9c38baf93e46a2223b524f91ff744cff2a0e1157
xgettext: Fix crash with *.po file input

When xgettext was given two *.po files with the same msgid_plural, it
crashed with double-free.  Problem reported by Davlet Panech in:
http://lists.gnu.org/archive/html/bug-gettext/2016-09/msg00001.html
* gettext-tools/src/po-gram-gen.y: Don't free msgid_pluralform after
calling do_callback_message, assuming that it takes ownership.
* gettext-tools/src/read-catalog.c (default_add_message): Free
msgid_plural after calling message_alloc.
* gettext-tools/tests/xgettext-po-2: New file.
* gettext-tools/tests/Makefile.am (TESTS): Add new test.
gettext-tools/src/po-gram-gen.y
gettext-tools/src/read-catalog.c
gettext-tools/tests/Makefile.am
gettext-tools/tests/xgettext-po-2 [new file with mode: 0755]