bugGNU gettext - Bugs: bug #63530, xgettext: return value not checked...

 
 

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

bug #63530: xgettext: return value not checked in locating_rule_list_add_from_file() [NULL-ptr dereference]

Submitter:  Shashank <theshank>
Submitted:  Thu 15 Dec 2022 01:05:28 AM UTC
   
 
Category:  XML Severity:  3 - Normal
Item Group:  None Status:  Fix Released
Privacy:  Public Assigned to:  ueno
Open/Closed:  Closed

Sat 17 Jun 2023 01:50:09 PM UTC, comment #3: 

The fix is contained in gettext 0.22.

Bruno Haible <haible>
Group administrator
Sun 05 Mar 2023 01:54:06 AM UTC, comment #2: 
Daiki Ueno <ueno>
Group administrator
Thu 15 Dec 2022 02:44:48 AM UTC, comment #1: 

This code gets only used when parsing .loc files, indicated through command-line options and/or environment variables to the msgfmt and xgettext programs.

The .loc files shipped with gettext apparently have the correct XML syntax.

Still, I agree that the code could be made more robust.

Bruno Haible <haible>
Group administrator
Thu 15 Dec 2022 01:05:28 AM UTC, original submission:  

In locating_rule_list_add_from_file() (located in gettext-tools/src/locating-rule.c), the return value of xmlDocGetRootElement() is not checked before continuing further, which would cause a NULL-ptr dereference on the very next line, whenever xmlDocGetRootElement() returns NULL.


static bool
locating_rule_list_add_from_file (struct locating_rule_list_ty *rules,
                                  const char *rule_file_name)
{
  ...
  root = xmlDocGetRootElement (doc);
  if (!(xmlStrEqual (root->name, BAD_CAST "locatingRules")
  ...
}
-verbatim+

Shashank <theshank>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by ueno (Posted a comment)
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by theshank (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-06-17 haible StatusFixed Fix Released
    2023-03-05 ueno StatusConfirmed Fixed
        Assigned toNone ueno
        Open/ClosedOpen Closed
    2022-12-15 haible CategoryC XML
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code