From 94b4cda3bcf2c1b4539684ba71ce4548c91e5556 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Fri, 5 Jan 2018 10:19:37 +0100 Subject: [PATCH] xgettext: fix --its segfault Resolves: rhbz#1531476 Version: 0.19.8.1-12 --- gettext-0.19.8-its-segfault.patch | 43 +++++++++++++++++++++++++++++++ gettext.spec | 8 +++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 gettext-0.19.8-its-segfault.patch diff --git a/gettext-0.19.8-its-segfault.patch b/gettext-0.19.8-its-segfault.patch new file mode 100644 index 0000000..430719f --- /dev/null +++ b/gettext-0.19.8-its-segfault.patch @@ -0,0 +1,43 @@ +From a0cab23332a254e3500cac2a3a984472d02180e5 Mon Sep 17 00:00:00 2001 +From: Bruno Haible +Date: Fri, 9 Dec 2016 21:04:31 +0100 +Subject: [PATCH] Fix crash of xgettext with --its option. + +* gettext-tools/src/xgettext.c (main): Free contents of its_dirs only when it +was initialized. Fixes bug introduced on 2016-05-16. +--- + gettext-tools/src/xgettext.c | 11 +++++++---- + 1 file changed, 7 insertions(+), 4 deletions(-) + +diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c +index f848d76d1..a80ee51ac 100644 +--- a/gettext-tools/src/xgettext.c ++++ b/gettext-tools/src/xgettext.c +@@ -330,7 +330,7 @@ main (int argc, char *argv[]) + bool sort_by_msgid = false; + bool sort_by_filepos = false; + char **dirs; +- char **its_dirs; ++ char **its_dirs = NULL; + char *explicit_its_filename = NULL; + const char *file_name; + const char *files_from = NULL; +@@ -1016,9 +1016,12 @@ warning: file '%s' extension '%s' is unknown; will try C"), filename, extension) + if (its_locating_rules) + locating_rule_list_free (its_locating_rules); + +- for (i = 0; its_dirs[i] != NULL; i++) +- free (its_dirs[i]); +- free (its_dirs); ++ if (its_dirs != NULL) ++ { ++ for (i = 0; its_dirs[i] != NULL; i++) ++ free (its_dirs[i]); ++ free (its_dirs); ++ } + + exit (EXIT_SUCCESS); + } +-- +2.14.3 + diff --git a/gettext.spec b/gettext.spec index 3ec7495..15f0257 100644 --- a/gettext.spec +++ b/gettext.spec @@ -8,7 +8,7 @@ Summary: GNU libraries and utilities for producing multi-lingual messages Name: gettext Version: 0.19.8.1 -Release: 11%{?dist} +Release: 12%{?dist} License: GPLv3+ and LGPLv2+ Group: Development/Tools URL: http://www.gnu.org/software/gettext/ @@ -20,6 +20,9 @@ Patch0: disable-gettext-runtime-test-lock.patch # Upstreamed patch: # http://lists.gnu.org/archive/html/bug-gettext/2016-08/msg00006.html Patch1: gettext-po-send-mail.patch +# Rhbz#1531476, upstream a0cab23332a254e3500cac2a3a984472d02180e5 +Patch2: gettext-0.19.8-its-segfault.patch + Source2: msghack.py Source3: msghack.1 # for bootstrapping @@ -352,6 +355,9 @@ fi %{_mandir}/man1/msghack.1* %changelog +* Fri Jan 05 2018 Pavel Raiskup - 0.19.8.1-12 +- xgettext --its segfault fix (rhbz#1531476) + * Wed Aug 02 2017 Fedora Release Engineering - 0.19.8.1-11 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild