patches/avl_ptrcmp.dif
author rohinis
Tue, 29 Nov 2011 17:32:55 +0000
branchs11express-2010-11
changeset 22234 c23e64da3e06
parent 9397 b16e349d18c5
permissions -rw-r--r--
2011-11-29 Rohini S <[email protected]> * patches/Python26-22-audio.diff: Fixes CVE-2010-1634 * specs/SUNWPython26.spec: Fixes CR 7085446

--- servers/slapd/proto-slap.h	2003/07/22 08:24:49	1.1
+++ servers/slapd/proto-slap.h	2003/07/22 08:25:56
@@ -999,6 +999,9 @@
 	BerVarray *vals,
 	BerVarray addvals ));
 
+/* assumes (x) > (y) returns 1 if true, 0 otherwise */
+#define SLAP_PTRCMP(x, y) ((x) < (y) ? -1 : (x) > (y))
+
 /*
  * Other...
  */
--- servers/slapd/back-ldbm/attr.c	2003/07/22 08:25:02	1.1
+++ servers/slapd/back-ldbm/attr.c	2003/07/22 08:28:21
@@ -27,7 +27,7 @@
     AttrInfo	*a
 )
 {
-	return desc - a->ai_desc;
+	return SLAP_PTRCMP(desc, a->ai_desc);
 }
 
 static int
@@ -36,7 +36,7 @@
     AttrInfo	*b
 )
 {
-	return a->ai_desc - b->ai_desc;
+	return SLAP_PTRCMP(a->ai_desc, b->ai_desc);
 }
 
 void
--- servers/slapd/back-bdb/attr.c	2003/07/22 08:25:08	1.1
+++ servers/slapd/back-bdb/attr.c	2003/07/22 08:29:13
@@ -27,7 +27,7 @@
 	AttrInfo	*a
 )
 {
-	return desc - a->ai_desc;
+	return SLAP_PTRCMP(desc, a->ai_desc);
 }
 
 static int
@@ -36,7 +36,7 @@
 	AttrInfo	*b
 )
 {
-	return a->ai_desc - b->ai_desc;
+	return SLAP_PTRCMP(a->ai_desc, b->ai_desc);
 }
 
 void