]> git.sur5r.net Git - openldap/commitdiff
fix SASL numeric secprops parsing (ITS#3955)
authorPierangelo Masarati <ando@openldap.org>
Sat, 20 Aug 2005 14:22:42 +0000 (14:22 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 20 Aug 2005 14:22:42 +0000 (14:22 +0000)
libraries/libldap/cyrus.c

index 18c493688c262d9eafc5f5d99a03a18abe223dfe..564cee70726c602bc14e93eb788dfcdb5cbe92fd 100644 (file)
@@ -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;