bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #63529] xgettext: potential null-ptr dereference in XML resource lo


From: Shashank
Subject: [bug #63529] xgettext: potential null-ptr dereference in XML resource locating rules
Date: Wed, 14 Dec 2022 19:58:37 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?63529>

                 Summary: xgettext: potential null-ptr dereference in XML
resource locating rules
                 Project: GNU gettext
               Submitter: theshank
               Submitted: Thu 15 Dec 2022 12:58:35 AM UTC
                Category: C
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Thu 15 Dec 2022 12:58:35 AM UTC By: Shashank <theshank>
In gettext-tools/src/locating-rule.c, the following code does not check the
return value of xmlGetProp, which would lead to NULL-pointer dereference in
xstrdup() (in gettext-tools/gnulib-lib/xstrdup.c) whenever xmlGetProp()
returns NULL.


static char *
get_attribute (xmlNode *node, const char *attr)
{
  xmlChar *value;
  char *result;

  value = xmlGetProp (node, BAD_CAST attr);
  result = xstrdup ((const char *) value);
  xmlFree (value);

  return result;
}








    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?63529>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]