Gitweb links:

...log 
http://git.netsurf-browser.org/libdom.git/shortlog/b9b81b9b8a34f5b3a9069c111c4d7530d73a04ce
...commit 
http://git.netsurf-browser.org/libdom.git/commit/b9b81b9b8a34f5b3a9069c111c4d7530d73a04ce
...tree 
http://git.netsurf-browser.org/libdom.git/tree/b9b81b9b8a34f5b3a9069c111c4d7530d73a04ce

The branch, master has been updated
       via  b9b81b9b8a34f5b3a9069c111c4d7530d73a04ce (commit)
      from  d055eaf25d60a1c1538bacc32d5e51a073477ebb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/libdom.git/commit/?id=b9b81b9b8a34f5b3a9069c111c4d7530d73a04ce
commit b9b81b9b8a34f5b3a9069c111c4d7530d73a04ce
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>

    protect expat parser from null current node

diff --git a/bindings/xml/expat_xmlparser.c b/bindings/xml/expat_xmlparser.c
index e1c22ad..4bdd5c9 100644
--- a/bindings/xml/expat_xmlparser.c
+++ b/bindings/xml/expat_xmlparser.c
@@ -45,6 +45,11 @@ expat_xmlparser_start_element_handler(void *_parser,
        dom_string *namespace = NULL;
        const XML_Char *ns_sep = strchr(name, '\n');
 
+        if (parser->current == NULL) {
+                /* not currently building a node so cannot add elemnt to it */
+                return;
+        }
+
        if (ns_sep != NULL) {
                err = dom_string_create_interned((const uint8_t *)name,
                                                 ns_sep - name,
@@ -174,6 +179,13 @@ expat_xmlparser_end_element_handler(void *_parser,
 
        UNUSED(name);
 
+        if (parser->current == NULL) {
+                /* not currently building a node so cannot end elemnt
+                 * addition to it.
+                 */
+                return;
+        }
+
        err = dom_node_get_parent_node(parser->current, &parent);
 
        if (err != DOM_NO_ERR) {
@@ -213,6 +225,11 @@ expat_xmlparser_cdata_handler(void *_parser,
        struct dom_node *cdata, *ins_cdata, *lastchild = NULL;
        dom_node_type ntype = 0;
 
+        if (parser->current == NULL) {
+                /* not currently building a node so cannot add cdata to it */
+                return;
+        }
+
        err = dom_string_create((const uint8_t *)s, len, &data);
        if (err != DOM_NO_ERR) {
                parser->msg(DOM_MSG_CRITICAL, parser->mctx,


-----------------------------------------------------------------------

Summary of changes:
 bindings/xml/expat_xmlparser.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/bindings/xml/expat_xmlparser.c b/bindings/xml/expat_xmlparser.c
index e1c22ad..4bdd5c9 100644
--- a/bindings/xml/expat_xmlparser.c
+++ b/bindings/xml/expat_xmlparser.c
@@ -45,6 +45,11 @@ expat_xmlparser_start_element_handler(void *_parser,
        dom_string *namespace = NULL;
        const XML_Char *ns_sep = strchr(name, '\n');
 
+        if (parser->current == NULL) {
+                /* not currently building a node so cannot add elemnt to it */
+                return;
+        }
+
        if (ns_sep != NULL) {
                err = dom_string_create_interned((const uint8_t *)name,
                                                 ns_sep - name,
@@ -174,6 +179,13 @@ expat_xmlparser_end_element_handler(void *_parser,
 
        UNUSED(name);
 
+        if (parser->current == NULL) {
+                /* not currently building a node so cannot end elemnt
+                 * addition to it.
+                 */
+                return;
+        }
+
        err = dom_node_get_parent_node(parser->current, &parent);
 
        if (err != DOM_NO_ERR) {
@@ -213,6 +225,11 @@ expat_xmlparser_cdata_handler(void *_parser,
        struct dom_node *cdata, *ins_cdata, *lastchild = NULL;
        dom_node_type ntype = 0;
 
+        if (parser->current == NULL) {
+                /* not currently building a node so cannot add cdata to it */
+                return;
+        }
+
        err = dom_string_create((const uint8_t *)s, len, &data);
        if (err != DOM_NO_ERR) {
                parser->msg(DOM_MSG_CRITICAL, parser->mctx,


-- 
Document Object Model library

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to