Forgot to check a pointer, fixes bug #96495 Daniel
authorDaniel Veillard <veillard@src.gnome.org>
Tue, 22 Oct 2002 19:02:40 +0000 (19:02 +0000)
committerDaniel Veillard <veillard@src.gnome.org>
Tue, 22 Oct 2002 19:02:40 +0000 (19:02 +0000)
* libxslt/pattern.c: Forgot to check a pointer, fixes bug #96495
Daniel

ChangeLog
libxslt/pattern.c

index bfc03fb..6ca4fd4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Tue Oct 22 21:02:37 CEST 2002 Daniel Veillard <daniel@veillard.com>
+
+       * libxslt/pattern.c: Forgot to check a pointer, fixes bug #96495
+
 Tue Oct 22 20:53:10 CEST 2002 Daniel Veillard <daniel@veillard.com>
 
        * libxslt/keys.h: fixed include c.f. bug #96487
index c88b33d..ae0b07a 100644 (file)
@@ -702,6 +702,8 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
                            if (sibling == previous)
                                break;
                            if ((node->type == XML_ELEMENT_NODE) &&
+                               (node->name != NULL) &&
+                               (sibling->name != NULL) &&
                                (node->name[0] == sibling->name[0]) &&
                                (xmlStrEqual(node->name, sibling->name))) {
                                if ((select->value2 == NULL) ||
@@ -756,8 +758,10 @@ xsltTestCompMatch(xsltTransformContextPtr ctxt, xsltCompMatchPtr comp,
                                if (siblings == node) {
                                    len++;
                                    pos = len;
-                               } else if ((node->name[0] == siblings->name[0])
-                              && (xmlStrEqual(node->name, siblings->name))) {
+                               } else if ((node->name != NULL) &&
+                                          (siblings->name != NULL) &&
+                                   (node->name[0] == siblings->name[0]) &&
+                                   (xmlStrEqual(node->name, siblings->name))) {
                                    if ((select->value2 == NULL) ||
                                        ((siblings->ns != NULL) &&
                                         (xmlStrEqual(select->value2,