]> git.sur5r.net Git - openldap/blob - libraries/libldap/messages.c
Fix ITS#1843, don't deref NULL string in ldap_pvt_str2upper
[openldap] / libraries / libldap / messages.c
1 /* $OpenLDAP$ */
2 /*
3  * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
4  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
5  */
6 /*
7  *  messages.c
8  */
9
10 #include "portable.h"
11
12 #include <stdio.h>
13
14 #include <ac/stdlib.h>
15
16 #include <ac/socket.h>
17 #include <ac/string.h>
18 #include <ac/time.h>
19
20 #include "ldap-int.h"
21
22 LDAPMessage *
23 ldap_first_message( LDAP *ld, LDAPMessage *chain )
24 {
25         assert( ld != NULL );
26         assert( LDAP_VALID( ld ) );
27         assert( chain != NULL );
28
29         return chain;
30 }
31
32 LDAPMessage *
33 ldap_next_message( LDAP *ld, LDAPMessage *msg )
34 {
35         assert( ld != NULL );
36         assert( LDAP_VALID( ld ) );
37         assert( msg != NULL );
38
39         return msg->lm_chain;
40 }
41
42 int
43 ldap_count_messages( LDAP *ld, LDAPMessage *chain )
44 {
45         int     i;
46
47         assert( ld != NULL );
48         assert( LDAP_VALID( ld ) );
49
50         for ( i = 0; chain != NULL; chain = chain->lm_chain ) {
51                 i++;
52         }
53
54         return( i );
55 }