Sorry, the package version should be 0.19.8.1-4.

Attached please find a debdiff with the fix.

--
Gunnar Hjalmarsson
https://launchpad.net/~gunnarhj
diff -Nru gettext-0.19.8.1.orig/debian/changelog 
gettext-0.19.8.1/debian/changelog
--- gettext-0.19.8.1.orig/debian/changelog      2017-08-22 03:20:24.000000000 
+0200
+++ gettext-0.19.8.1/debian/changelog   2018-02-24 19:24:42.452655811 +0100
@@ -1,3 +1,11 @@
+gettext (0.19.8.1-5) unstable; urgency=medium
+
+  * debian/patches/04-fix-crash-xgettext-with-its.patch:
+    - Stop xgettext() from crashing when run with --its=FILE option
+      Closes: #891347, LP: #1751261
+
+ -- Gunnar Hjalmarsson <gunna...@ubuntu.com>  Sat, 24 Feb 2018 19:24:00 +0100
+
 gettext (0.19.8.1-4) unstable; urgency=medium
 
   * Avoid extraneous NUL bytes in .mo files. Closes: #872869.
diff -Nru 
gettext-0.19.8.1.orig/debian/patches/04-fix-crash-xgettext-with-its.patch 
gettext-0.19.8.1/debian/patches/04-fix-crash-xgettext-with-its.patch
--- gettext-0.19.8.1.orig/debian/patches/04-fix-crash-xgettext-with-its.patch   
1970-01-01 01:00:00.000000000 +0100
+++ gettext-0.19.8.1/debian/patches/04-fix-crash-xgettext-with-its.patch        
2018-02-23 21:40:12.801136733 +0100
@@ -0,0 +1,40 @@
+From: Bruno Haible <br...@clisp.org>
+Date: Fri, 9 Dec 2016 20:04:31 +0000 (+0100)
+Subject: Fix crash of xgettext with --its option.
+X-Git-Url: 
http://git.savannah.gnu.org/gitweb/?p=gettext.git;a=commitdiff_plain;h=a0cab23332a254e3500cac2a3a984472d02180e5
+
+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.
+---
+
+diff --git a/gettext-tools/src/xgettext.c b/gettext-tools/src/xgettext.c
+index f848d76..a80ee51 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);
+ }
diff -Nru gettext-0.19.8.1.orig/debian/patches/series 
gettext-0.19.8.1/debian/patches/series
--- gettext-0.19.8.1.orig/debian/patches/series 2017-08-22 02:00:00.000000000 
+0200
+++ gettext-0.19.8.1/debian/patches/series      2018-02-23 21:41:51.725794456 
+0100
@@ -1,3 +1,4 @@
 01-do-not-use-java-in-urlget.patch
 02-msgfmt-remove-pot-creation-date.patch
 03-avoid-extraneous-nul-bytes.patch
+04-fix-crash-xgettext-with-its.patch

Reply via email to