bugGNU gettext - Bugs: bug #30741, gettextlib accepts comments that...

 
 

bug #30741: gettextlib accepts comments that break PO files

Submitted by:  None
Submitted on:  Wed 11 Aug 2010 02:05:23 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Not a Bug
Privacy: PublicAssigned to: Miguel Ángel Arruga Vivas <m1gu3l>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 05 Mar 2013 02:54:51 AM UTC, comment #4:

Closing this because we can't handle it without proper escaping rule in the comment syntax and hopefully it would be easy to check if the comment string ends with a backslash in the caller side.

Daiki Ueno <ueno>
Project Administrator
Sun 03 Mar 2013 10:13:49 AM UTC, comment #3:

Saturday night patches always need reviewing. Thank you, Daiki. :)

Also comments are welcome, it may not be a bug, because that kind of backslash it is too picky to be real.

(file #27559)

Miguel Ángel Arruga Vivas <m1gu3l>
Project MemberIn charge of this item.
Sun 03 Mar 2013 07:56:02 AM UTC, comment #2:

Well, the patch looks not correct.

+ memcpy (".", buffer + length, 2);

memcpy's first argument is the destination, not source.

Also I wonder if we can silently modify the supplied comment like that...

Daiki Ueno <ueno>
Project Administrator
Sun 03 Mar 2013 01:49:07 AM UTC, comment #1:

The attached patch is a proposal for testing.

(file #27555)

Miguel Ángel Arruga Vivas <m1gu3l>
Project MemberIn charge of this item.
Wed 11 Aug 2010 02:05:23 AM UTC, original submission:

po_message_set_extracted_comments("A comment\\")

Or

po_message_set_comments("A comment\\")

Will create a PO message like this:

# Something \
msgid "One"
msgstr "Een"

msgfmt -cv x.po
Causes this error:
x.po:3:7: syntax error

Problem
=======
gettextlib accepts input that creates broken PO files without complaint.

Solution
========
1) Warn about broken input - not ideal as then tools need to manage checking for broken input
2) Escape \ at the end of the line or pad it with a single space.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #27559:  gettextpo.patch added by m1gu3l (2kB - text/x-patch)
file #27555:  gettextpo.patch added by m1gu3l (2kB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by ueno (Posted a comment)
  • -unavailable- added by m1gu3l (Updated the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 05 Mar 2013 02:54:51 AM UTCuenoOpen/ClosedOpen=>Closed
    Mon 04 Mar 2013 10:58:26 AM UTCm1gu3lStatusReady For Test=>Not a Bug
    Sun 03 Mar 2013 10:13:49 AM UTCm1gu3lAttached File-=>Added gettextpo.patch, #27559
    Sun 03 Mar 2013 01:49:07 AM UTCm1gu3lAttached File-=>Added gettextpo.patch, #27555
      StatusNone=>Ready For Test
      Assigned toNone=>m1gu3l

    Back to the top


    Powered by Savane 3.1-cleanup