~ubuntu-branches/ubuntu/precise/libxslt/precise-updates

« back to all changes in this revision

Viewing changes to libxslt/xsltutils.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-09-28 15:13:38 UTC
  • mfrom: (28.1.1 precise-proposed)
  • Revision ID: package-import@ubuntu.com-20120928151338-yfhkskiueudfqcl0
Tags: 1.1.26-8ubuntu1.2
* SECURITY UPDATE: denial of service via out-of-bounds read
  - libxslt/pattern.c: fix improper loop exit.
  - fe5a4fa33eb85bce3253ed3742b1ea6c4b59b41b
  - CVE-2011-3970
* SECURITY UPDATE: denial of service via out-of-bounds read
  - libxslt/xsltutils.h: check for XML_ELEMENT_NODE
  - e6a0bc8081271f33b9899eb78e1da1a2a0428419
  - CVE-2012-2825
* SECURITY UPDATE: denial of service via crafted XSLT expression
  - harden code in libexslt/functions.c, libxslt/attributes.c,
    libxslt/functions.c, libxslt/pattern.c, libxslt/preproc.c,
    libxslt/templates.c, libxslt/transform.c, libxslt/variables.c,
    libxslt/xslt.c, libxslt/xsltutils.c.
  - 8566ab4a10158d195adb5f1f61afe1ee8bfebd12
  - 4da0f7e207f14a03daad4663865c285eb27f93e9
  - 24653072221e76d2f1f06aa71225229b532f8946
  - 1564b30e994602a95863d9716be83612580a2fed
  - CVE-2012-2870
* SECURITY UPDATE: denial of service and possible code execution during
  handling of XSL transforms
  - libxslt/transform.c: check for XML_NAMESPACE_DECL
  - 937ba2a3eb42d288f53c8adc211bd1122869f0bf
  - CVE-2012-2871
* SECURITY UPDATE: denial of service and possible code execution via
  double free during XSL transforms
  - libxslt/templates.c: Fix dictionary string usage
  - 54977ed7966847e305a2008cb18892df26eeb065
  - CVE-2012-2893

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
    if ((node == NULL) || (style == NULL) || (style->dict == NULL))
91
91
        return(NULL);
92
92
 
93
 
    prop = node->properties;
94
 
    if (nameSpace == NULL) {
 
93
    if (nameSpace == NULL)
95
94
        return xmlGetProp(node, name);
96
 
    }
 
95
 
 
96
    if (node->type == XML_NAMESPACE_DECL)
 
97
        return(NULL);
 
98
    if (node->type == XML_ELEMENT_NODE)
 
99
        prop = node->properties;
 
100
    else
 
101
        prop = NULL;
97
102
    while (prop != NULL) {
98
103
        /*
99
104
         * One need to have
130
135
            attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
131
136
            if ((attrDecl == NULL) && (doc->extSubset != NULL))
132
137
                attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
133
 
                
 
138
 
134
139
            if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) {
135
140
                /*
136
141
                 * The DTD declaration only allows a prefix search
172
177
    if (node == NULL)
173
178
        return(NULL);
174
179
 
175
 
    prop = node->properties;
 
180
    if (nameSpace == NULL)
 
181
        return xmlGetProp(node, name);
 
182
 
 
183
    if (node->type == XML_NAMESPACE_DECL)
 
184
        return(NULL);
 
185
    if (node->type == XML_ELEMENT_NODE)
 
186
        prop = node->properties;
 
187
    else
 
188
        prop = NULL;
176
189
    /*
177
190
    * TODO: Substitute xmlGetProp() for xmlGetNsProp(), since the former
178
191
    * is not namespace-aware and will return an attribute with equal
182
195
    *   So this would return "myName" even if an attribute @name
183
196
    *   in the XSLT was requested.
184
197
    */
185
 
    if (nameSpace == NULL)
186
 
        return(xmlGetProp(node, name));
187
198
    while (prop != NULL) {
188
199
        /*
189
200
         * One need to have
216
227
            attrDecl = xmlGetDtdAttrDesc(doc->intSubset, node->name, name);
217
228
            if ((attrDecl == NULL) && (doc->extSubset != NULL))
218
229
                attrDecl = xmlGetDtdAttrDesc(doc->extSubset, node->name, name);
219
 
                
 
230
 
220
231
            if ((attrDecl != NULL) && (attrDecl->prefix != NULL)) {
221
232
                /*
222
233
                 * The DTD declaration only allows a prefix search