Segmentation fault in msgmerge (with patch)

View: New views
2 Messages — Rating Filter:   Alert me  

Segmentation fault in msgmerge (with patch)

by Peter Eisentraut-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I experience a segmentation fault when msgmerge runs a particular merge that
appears to involve plural forms.  This is reproducible with 0.17 and git head.

It appears that there is an obvious typo in the code.  I have attached a
patch.  I have also attached a test case (unpack and runme.sh) in case you
need convincing. ;-)

[msgmerge-segfault-fix.patch]

--- gettext-0.17.orig/gettext-tools/src/msgl-iconv.c
+++ gettext-0.17/gettext-tools/src/msgl-iconv.c
@@ -411,7 +411,7 @@
   if (mp->prev_msgid != NULL)
     if (!iconvable_string (cd, mp->prev_msgid))
       return false;
-  if (mp->msgid_plural != NULL)
+  if (mp->prev_msgid_plural != NULL)
     if (!iconvable_string (cd, mp->prev_msgid_plural))
       return false;
   return true;



testcase.tar.gz (23K) Download Attachment

Re: Segmentation fault in msgmerge (with patch)

by Bruno Haible :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Peter Eisentraut wrote:
> I experience a segmentation fault when msgmerge runs a particular merge that
> appears to involve plural forms.  This is reproducible with 0.17 and git head.
>
> It appears that there is an obvious typo in the code.  I have attached a
> patch.  I have also attached a test case (unpack and runme.sh) in case you
> need convincing. ;-)

Thank you. Your bug fix has been applied to gettext's CVS on 2008-05-16.
It will be contained in the next release.

Bruno