From: Kurt Zeilenga Date: Wed, 19 May 1999 06:27:35 +0000 (+0000) Subject: Add UL to more BER tags. X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~51 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f9bbdb34c5907d37d41864d04314861367de5675;p=openldap Add UL to more BER tags. --- diff --git a/libraries/liblber/decode.c b/libraries/liblber/decode.c index d2e81df26e..aed5ca4e5f 100644 --- a/libraries/liblber/decode.c +++ b/libraries/liblber/decode.c @@ -71,7 +71,8 @@ ber_skip_tag( BerElement *ber, unsigned long *len ) { unsigned long tag; unsigned char lc; - int noctets, diff; + unsigned int noctets; + int diff; unsigned long netlen; assert( ber != NULL ); @@ -109,7 +110,7 @@ ber_skip_tag( BerElement *ber, unsigned long *len ) if ( (unsigned) noctets > sizeof(unsigned long) ) return( LBER_DEFAULT ); diff = sizeof(unsigned long) - noctets; - if ( ber_read( ber, (char *) &netlen + diff, noctets ) + if ( (unsigned) ber_read( ber, (char *) &netlen + diff, noctets ) != noctets ) return( LBER_DEFAULT ); *len = AC_NTOHL( netlen ); diff --git a/libraries/liblber/etest.c b/libraries/liblber/etest.c index b0cd89eafa..a41d9c379d 100644 --- a/libraries/liblber/etest.c +++ b/libraries/liblber/etest.c @@ -72,7 +72,7 @@ main( int argc, char **argv ) #ifndef notdef num = 7; - if ( ber_printf( ber, "{ti}", 0x1f44U, num ) == -1 ) { + if ( ber_printf( ber, "{ti}", 0x1f44UL, num ) == -1 ) { fprintf( stderr, "ber_printf returns -1" ); exit( 1 ); } diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 152336f7be..bfcec1b309 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -149,9 +149,11 @@ ldap_init( LDAP_CONST char *defhost, int defport ) memcpy(&ld->ld_options, &openldap_ldap_global_options, sizeof(ld->ld_options)); - /* but not pointers to malloc'ed strings */ + /* but not pointers to malloc'ed items */ ld->ld_options.ldo_defbase = NULL; ld->ld_options.ldo_defhost = NULL; + ld->ld_options.ldo_sctrls = NULL; + ld->ld_options.ldo_cctrls = NULL; if ( defhost != NULL ) { ld->ld_options.ldo_defhost = strdup( defhost ); diff --git a/libraries/libldap/result.c b/libraries/libldap/result.c index 3da2edba64..68057ab7b4 100644 --- a/libraries/libldap/result.c +++ b/libraries/libldap/result.c @@ -540,7 +540,7 @@ build_result_ber( LDAP *ld, BerElement *ber, LDAPRequest *lr ) ber_init_w_nullc( ber, 0 ); ldap_set_ber_options( ld, ber ); if ( ber_printf( ber, "{it{ess}}", lr->lr_msgid, - (long)lr->lr_res_msgtype, lr->lr_res_errno, + (unsigned long) lr->lr_res_msgtype, lr->lr_res_errno, lr->lr_res_matched ? lr->lr_res_matched : "", lr->lr_res_error ? lr->lr_res_error : "" ) == -1 ) { return( LBER_ERROR ); diff --git a/libraries/libldap/sbind.c b/libraries/libldap/sbind.c index e6a4f96bd4..d52ea2909c 100644 --- a/libraries/libldap/sbind.c +++ b/libraries/libldap/sbind.c @@ -99,7 +99,7 @@ ldap_simple_bind_s( LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd ) if ( (msgid = ldap_simple_bind( ld, dn, passwd )) == -1 ) return( ld->ld_errno ); - if ( ldap_result( ld, msgid, 1, (struct timeval *) 0, &result ) == -1 ) + if ( ldap_result( ld, msgid, 1, NULL, &result ) == -1 ) return( ld->ld_errno ); /* ldap_result sets ld_errno */ return( ldap_result2error( ld, result, 1 ) );