From: Howard Chu Date: Mon, 5 Feb 2007 20:38:25 +0000 (+0000) Subject: Require non-NULL input for timeout options X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~72 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=75d0b4ee97b3decfbaafbce5b532063422e9a478;p=openldap Require non-NULL input for timeout options --- diff --git a/libraries/libldap/options.c b/libraries/libldap/options.c index 3f0c1b2ca1..8a46d53d32 100644 --- a/libraries/libldap/options.c +++ b/libraries/libldap/options.c @@ -442,19 +442,6 @@ ldap_set_option( } } return LDAP_OPT_SUCCESS; - case LDAP_OPT_TIMEOUT: { - const struct timeval *tv = - (const struct timeval *) invalue; - - lo->ldo_tm_api = *tv; - } return LDAP_OPT_SUCCESS; - - case LDAP_OPT_NETWORK_TIMEOUT: { - const struct timeval *tv = - (const struct timeval *) invalue; - - lo->ldo_tm_net = *tv; - } return LDAP_OPT_SUCCESS; case LDAP_OPT_HOST_NAME: { const char *host = (const char *) invalue; @@ -661,6 +648,8 @@ ldap_set_option( case LDAP_OPT_PROTOCOL_VERSION: case LDAP_OPT_RESULT_CODE: case LDAP_OPT_DEBUG_LEVEL: + case LDAP_OPT_TIMEOUT: + case LDAP_OPT_NETWORK_TIMEOUT: if(invalue == NULL) { /* no place to set from */ return LDAP_OPT_ERROR; @@ -698,6 +687,20 @@ ldap_set_option( lo->ldo_timelimit = * (const int *) invalue; return LDAP_OPT_SUCCESS; + case LDAP_OPT_TIMEOUT: { + const struct timeval *tv = + (const struct timeval *) invalue; + + lo->ldo_tm_api = *tv; + } return LDAP_OPT_SUCCESS; + + case LDAP_OPT_NETWORK_TIMEOUT: { + const struct timeval *tv = + (const struct timeval *) invalue; + + lo->ldo_tm_net = *tv; + } return LDAP_OPT_SUCCESS; + case LDAP_OPT_PROTOCOL_VERSION: { int vers = * (const int *) invalue; if (vers < LDAP_VERSION_MIN || vers > LDAP_VERSION_MAX) {