From 3dd05cdb2dcb3be86048e70bb4662e867f35859d Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 20 Aug 2005 14:22:42 +0000 Subject: [PATCH] fix SASL numeric secprops parsing (ITS#3955) --- libraries/libldap/cyrus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c index 18c493688c..564cee7072 100644 --- a/libraries/libldap/cyrus.c +++ b/libraries/libldap/cyrus.c @@ -983,9 +983,10 @@ int ldap_pvt_sasl_secprops( sprops[j].key.bv_len )) continue; if ( sprops[j].ival ) { int v; - if ( props[i][sprops[j].key.bv_len] != '=' ) continue; - if ( !isdigit( props[i][sprops[j].key.bv_len+1] )) continue; - v = atoi( props[i]+sprops[j].key.bv_len+1 ); + char *next = NULL; + if ( !isdigit( props[i][sprops[j].key.bv_len] )) continue; + v = strtoul( &props[i][sprops[j].key.bv_len], &next, 10 ); + if ( next == NULL || next[ 0 ] != '\0' ) continue; switch( sprops[j].ival ) { case GOT_MINSSF: min_ssf = v; got_min_ssf++; break; -- 2.39.5