]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_init.c
declare oc_bvfind_undef()
[openldap] / servers / slapd / schema_init.c
index e8c97c30e9b708c2b32f7ac1040521680105f3cb..6cbf98af2e433c028332a262d4631c12b03a061a 100644 (file)
@@ -2729,12 +2729,11 @@ int generalizedTimeFilter(
        
        bvtmp.bv_len = sizeof(tmp);
        bvtmp.bv_val = tmp;
-       keys = slap_sl_malloc( sizeof( struct berval ) * 2, ctx );
-
        /* GeneralizedTime YYYYmmddHH[MM[SS]][(./,)d...](Z|(+/-)HH[MM]) */
-       assert(value->bv_val != NULL && value->bv_len >= 10);
        /* Use 40 bits of time for key */
-       if ( lutil_parsetime( value->bv_val, &tm ) == 0 ) {
+       if ( value->bv_val && value->bv_len >= 10 &&
+               lutil_parsetime( value->bv_val, &tm ) == 0 ) {
+
                lutil_tm2time( &tm, &tt );
                tmp[0] = tt.tt_gsec & 0xff;
                tmp[4] = tt.tt_sec & 0xff;
@@ -2745,15 +2744,14 @@ int generalizedTimeFilter(
                tt.tt_sec >>= 8;
                tmp[1] = tt.tt_sec & 0xff;
 
+               keys = slap_sl_malloc( sizeof( struct berval ) * 2, ctx );
                ber_dupbv_x(keys, &bvtmp, ctx );
+               keys[1].bv_val = NULL;
+               keys[1].bv_len = 0;
        } else {
-               keys[0].bv_val = NULL;
-               keys[0].bv_len = 0;
+               keys = NULL;
        }
 
-       keys[1].bv_val = NULL;
-       keys[1].bv_len = 0;
-
        *keysp = keys;
 
        return LDAP_SUCCESS;
@@ -3080,8 +3078,8 @@ static slap_syntax_defs_rec syntax_defs[] = {
        {"( 1.2.36.79672281.1.5.0 DESC 'RDN' )",
                0, rdnValidate, rdnPretty},
 #ifdef LDAP_COMP_MATCH
-        {"( 1.2.36.79672281.1.5.3 DESC 'allComponents' )",
-                0, allComponentsValidate, NULL},
+       {"( 1.2.36.79672281.1.5.3 DESC 'allComponents' )",
+               0, allComponentsValidate, NULL},
        {"( 1.2.36.79672281.1.5.2 DESC 'componentFilterMatch assertion') ",
                0, componentFilterValidate, NULL},
 #endif