bugGNU gettext - Bugs: bug #43720, msgfilter aborts with empty msgstr

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #43720: msgfilter aborts with empty msgstr

Submitter:  Robin McCorkell <xenopathic>
Submitted:  Thu 27 Nov 2014 11:07:32 PM UTC
   
 
Category:  Translator tools Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  ueno
Open/Closed:  Closed

Fri 28 Nov 2014 04:29:54 AM UTC, comment #1: 

Thanks for the report.  It seems you hit a corner case.  When the read buffer is filled up, msgfilter.c:prepare_read tries to increase the size by 1.5 times larger than the previous size:


if (l->length == l->allocated)
  {
    l->allocated = l->allocated + (l->allocated >> 1);
    l->result = (char *) xrealloc (l->result, l->allocated);
  }


However, if the original l->allocated is 1, the size doesn't change.

I've pushed a fix:
http://git.sv.gnu.org/cgit/gettext.git/commit/?id=06e206f5

Daiki Ueno <ueno>
Group administrator
Thu 27 Nov 2014 11:07:32 PM UTC, original submission:  

When running msgfilter on a .po file that contains an empty msgstr, and the command prints anything, then msgfilter will abort. The abort does not occur however if the msgstr is non-empty, or if the command doesn't output anything.

For example:

    msgfilter -i test.po cat #doesn't abort, empty msgstr prints nothing
    msgfilter -i test.po echo -n #doesn't abort, no output
    msgfilter -i test.po echo -n 'a' #aborts on empty msgstr
    msgfilter -i test.po echo #aborts on empty msgstr

I did a bit of debugging, and it seems that the abort is called from pipe_filter_ii_execute in gnulib/lib/pipe-filter-ii.c:270, which doesn't make much sense as that should only be called if setting the SIGPIPE signal handler fails... which is totally unrelated to the output of the filter program?

Robin McCorkell <xenopathic>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #32564:  test.po added by xenopathic (115B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Updated the item)
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by xenopathic (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-01-04 haible StatusFixed Fix Released
    2016-11-27 haible CategoryNone Translator tools
        Assigned toNone ueno
    2014-11-28 ueno StatusNone Fixed
        Open/ClosedOpen Closed
    2014-11-27 xenopathic Attached File- Added test.po, #32564

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code