libxslt r1491 - in trunk: . libxslt



Author: veillard
Date: Tue Oct  7 16:26:24 2008
New Revision: 1491
URL: http://svn.gnome.org/viewvc/libxslt?rev=1491&view=rev

Log:
* libxslt/pattern.c: prevent some unchecked pointer accesses, patch
  by Jake Goulding
daniel


Modified:
   trunk/ChangeLog
   trunk/libxslt/pattern.c

Modified: trunk/libxslt/pattern.c
==============================================================================
--- trunk/libxslt/pattern.c	(original)
+++ trunk/libxslt/pattern.c	Tue Oct  7 16:26:24 2008
@@ -984,8 +984,10 @@
 			/*
 			 * recompute the index
 			 */
-			xmlNodePtr siblings = node->parent->children;
 			xmlNodePtr parent = node->parent;
+			xmlNodePtr siblings = NULL;
+
+                        if (parent) siblings = parent->children;
 
 			while (siblings != NULL) {
 			    if (siblings->type == XML_ELEMENT_NODE) {
@@ -1088,8 +1090,10 @@
 			/*
 			 * recompute the index
 			 */
-			xmlNodePtr siblings = node->parent->children;
 			xmlNodePtr parent = node->parent;
+			xmlNodePtr siblings = NULL;
+
+                        if (parent) siblings = parent->children;
 
 			while (siblings != NULL) {
 			    if (siblings->type == XML_ELEMENT_NODE) {



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