X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Foptions.c;h=956c5ef0a444ae242f774bfb3a2104ad9c3b5156;hb=b905811d3c800b6f4031d541e424e5de871aa0c7;hp=a75d4598c248170e3084315645e401c7c5e239d8;hpb=0f30db1c46cf576230cd9397f0d5ad2892da7325;p=openldap diff --git a/libraries/libldap/options.c b/libraries/libldap/options.c index a75d4598c2..956c5ef0a4 100644 --- a/libraries/libldap/options.c +++ b/libraries/libldap/options.c @@ -1,7 +1,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 1998-2010 The OpenLDAP Foundation. + * Copyright 1998-2011 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -367,6 +367,10 @@ ldap_get_option( break; case LDAP_OPT_SESSION_REFCNT: + if(ld == NULL) { + /* bad param */ + break; + } * (int *) outvalue = ld->ld_ldcrefcnt; rc = LDAP_OPT_SUCCESS; break; @@ -778,19 +782,22 @@ ldap_set_option( default: #ifdef HAVE_TLS - if ( ldap_pvt_tls_set_option( ld, option, (void *)invalue ) == 0 ) + if ( ldap_pvt_tls_set_option( ld, option, (void *)invalue ) == 0 ) { LDAP_MUTEX_UNLOCK( &lo->ldo_mutex ); return ( LDAP_OPT_SUCCESS ); + } #endif #ifdef HAVE_CYRUS_SASL - if ( ldap_int_sasl_set_option( ld, option, (void *)invalue ) == 0 ) + if ( ldap_int_sasl_set_option( ld, option, (void *)invalue ) == 0 ) { LDAP_MUTEX_UNLOCK( &lo->ldo_mutex ); return ( LDAP_OPT_SUCCESS ); + } #endif #ifdef HAVE_GSSAPI - if ( ldap_int_gssapi_set_option( ld, option, (void *)invalue ) == 0 ) + if ( ldap_int_gssapi_set_option( ld, option, (void *)invalue ) == 0 ) { LDAP_MUTEX_UNLOCK( &lo->ldo_mutex ); return ( LDAP_OPT_SUCCESS ); + } #endif /* bad param */ break; /* LDAP_OPT_ERROR */