]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/srchpref.c
Validate outvalue after session param.
[openldap] / libraries / libldap / srchpref.c
index 64f1c1b1c7dc04100570bfb122176f05606e0985..54405e341df20929eb33fb16ceb43b8d775c25ee 100644 (file)
@@ -20,7 +20,8 @@
 #include "portable.h"
 
 #include <stdio.h>
-#include <stdlib.h>
+
+#include <ac/stdlib.h>
 
 #include <ac/ctype.h>
 #include <ac/string.h>
@@ -98,14 +99,16 @@ ldap_init_searchprefs( char *file, struct ldap_searchobj **solistp )
 
 
 int
-ldap_init_searchprefs_buf( char *buf, long buflen,
+ldap_init_searchprefs_buf(
+       char *buf,
+       ber_len_t buflen,
        struct ldap_searchobj **solistp )
 {
     int                                rc = -1, version;
     char                       **toks;
     struct ldap_searchobj      *prevso, *so;
 
-    *solistp = prevso = NULLSEARCHOBJ;
+    *solistp = prevso = NULL;
 
     if ( next_line_tokens( &buf, &buflen, &toks ) != 2 ||
            strcasecmp( toks[ 0 ], "version" ) != 0 ) {
@@ -120,8 +123,8 @@ ldap_init_searchprefs_buf( char *buf, long buflen,
     }
 
     while ( buflen > 0 && ( rc = read_next_searchobj( &buf, &buflen, &so,
-           version )) == 0 && so != NULLSEARCHOBJ ) {
-       if ( prevso == NULLSEARCHOBJ ) {
+           version )) == 0 && so != NULL ) {
+       if ( prevso == NULL ) {
            *solistp = so;
        } else {
            prevso->so_next = so;
@@ -223,7 +226,7 @@ ldap_first_searchobj( struct ldap_searchobj *solist )
 struct ldap_searchobj *
 ldap_next_searchobj( struct ldap_searchobj *solist, struct ldap_searchobj *so )
 {
-    return( so == NULLSEARCHOBJ ? so : so->so_next );
+    return( so == NULL ? so : so->so_next );
 }