From: Howard Chu Date: Fri, 7 Mar 2003 12:40:37 +0000 (+0000) Subject: Don't call strlen ourselves, SASL getopt returns the lengths X-Git-Tag: NO_SLAP_OP_BLOCKS~165 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f881657c088c90569c7b047800c3470242aff827;p=openldap Don't call strlen ourselves, SASL getopt returns the lengths --- diff --git a/contrib/ldapsasl/ldapdb.c b/contrib/ldapsasl/ldapdb.c index f71d3e2cf5..df445e6f53 100644 --- a/contrib/ldapsasl/ldapdb.c +++ b/contrib/ldapsasl/ldapdb.c @@ -198,18 +198,18 @@ static int ldapdb_auxprop_plug_init(const sasl_utils_t *utils, utils->getopt(utils->getopt_context, ldapdb, "ldapdb_uri", &tmp.uri, NULL); if(!tmp.uri) return SASL_BADPARAM; - utils->getopt(utils->getopt_context, ldapdb, "ldapdb_id", (const char **)&tmp.id.bv_val, NULL); - utils->getopt(utils->getopt_context, ldapdb, "ldapdb_pw", (const char **)&tmp.pw.bv_val, NULL); - utils->getopt(utils->getopt_context, ldapdb, "ldapdb_mech", (const char **)&tmp.mech.bv_val, NULL); + utils->getopt(utils->getopt_context, ldapdb, "ldapdb_id", + (const char **)&tmp.id.bv_val, (unsigned *)&tmp.id.bv_len); + utils->getopt(utils->getopt_context, ldapdb, "ldapdb_pw", + (const char **)&tmp.pw.bv_val, (unsigned *)&tmp.pw.bv_len); + utils->getopt(utils->getopt_context, ldapdb, "ldapdb_mech", + (const char **)&tmp.mech.bv_val, (unsigned *)&tmp.mech.bv_len); utils->getopt(utils->getopt_context, ldapdb, "ldapdb_rc", &s, NULL); if(s && setenv("LDAPRC", s, 1)) return SASL_BADPARAM; p = utils->malloc(sizeof(ldapctx)); if (!p) return SASL_NOMEM; *p = tmp; - if (p->id.bv_val) p->id.bv_len = strlen(p->id.bv_val); - if (p->pw.bv_val) p->pw.bv_len = strlen(p->pw.bv_val); - if (p->mech.bv_val) p->mech.bv_len = strlen(p->mech.bv_val); ldapdb_auxprop_plugin.glob_context = p; *out_version = SASL_AUXPROP_PLUG_VERSION;