~ruther/guix-local

ref: ee6bb0cc763507b165674dbe03c6ae5d26c8da5c guix-local/gnu/packages/patches/libxml2-node-sort-order-pt1.patch -rw-r--r-- 917 bytes
ee6bb0cc — Mark H Weaver gnu: libxml2: Add fixes for CVE-2015-{1819,7941,7942,8035} and other bugs. 10 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From ba58f23c60862f2158b457f4d30031761bf4dde1 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Sun, 8 Mar 2015 16:44:11 +0100
Subject: [PATCH] Fix order of root nodes

Make sure root nodes are sorted before other nodes.
---
 xpath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/xpath.c b/xpath.c
index ffd2a48..e9f5bf9 100644
--- a/xpath.c
+++ b/xpath.c
@@ -361,13 +361,13 @@ turtle_comparison:
     /*
      * compute depth to root
      */
-    for (depth2 = 0, cur = node2;cur->parent != NULL;cur = cur->parent) {
+    for (depth2 = 0, cur = node2; cur != NULL; cur = cur->parent) {
 	if (cur == node1)
 	    return(1);
 	depth2++;
     }
     root = cur;
-    for (depth1 = 0, cur = node1;cur->parent != NULL;cur = cur->parent) {
+    for (depth1 = 0, cur = node1; cur != NULL; cur = cur->parent) {
 	if (cur == node2)
 	    return(-1);
 	depth1++;
-- 
2.6.3