]> git.sur5r.net Git - openldap/commitdiff
ITS#5909
authorQuanah Gibson-Mount <quanah@openldap.org>
Fri, 30 Jan 2009 21:12:54 +0000 (21:12 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Fri, 30 Jan 2009 21:12:54 +0000 (21:12 +0000)
CHANGES
libraries/liblutil/avl.c

diff --git a/CHANGES b/CHANGES
index d0daf013e60a3d9620992b1fb634f3806eb7f779..ebc1f4d9d43567f33b4a224eaa1cebf78b73e608 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,7 @@ OpenLDAP 2.4.14 Engineering
        Added libldap TLS_PROTOCOL_MIN (ITS#5655)
        Added libldap GnuTLS support for TLS_CIPHER_SUITE (ITS#5887)
        Added libldap GnuTLS setting random file (ITS#5462)
+       Fixed libldap avl to macroize constants (ITS#5909)
        Fixed libldap deref handling (ITS#5768)
        Fixed libldap peer cert memory leak (ITS#5849)
        Fixed libldap interaction with GnuTLS CN IP-based matches (ITS#5789)
index 6665307a364cfeb3abb1542e19200b7c51d9ab91..ef62a6ff57076b34214647c2a14b5f60847f2845 100644 (file)
@@ -34,6 +34,7 @@
 
 #include "portable.h"
 
+#include <limits.h>
 #include <stdio.h>
 #include <ac/stdlib.h>
 
@@ -48,6 +49,9 @@
 #define AVL_INTERNAL
 #include "avl.h"
 
+/* Maximum tree depth this host's address space could support */
+#define MAX_TREE_DEPTH (sizeof(void *) * CHAR_BIT)
+
 static const int avl_bfs[] = {LH, RH};
 
 /*
@@ -180,8 +184,8 @@ avl_delete( Avlnode **root, void* data, AVL_CMP fcmp )
        int side, side_bf, shorter, nside;
 
        /* parent stack */
-       Avlnode *pptr[sizeof(void *)*8];
-       unsigned char pdir[sizeof(void *)*8];
+       Avlnode *pptr[MAX_TREE_DEPTH];
+       unsigned char pdir[MAX_TREE_DEPTH];
        int depth = 0;
 
        if ( *root == NULL )