]> git.sur5r.net Git - openldap/commitdiff
Fixed segfault in caseIgnoreFilter when assertion value has bad UTF8 coding
authorStig Venaas <venaas@openldap.org>
Sun, 15 Jul 2001 16:21:36 +0000 (16:21 +0000)
committerStig Venaas <venaas@openldap.org>
Sun, 15 Jul 2001 16:21:36 +0000 (16:21 +0000)
servers/slapd/schema_init.c

index 444f89c104caab231917b7ae13e41216bcc0d380..89aaa108ee9fb5292ed8fc2519790bc6ce873a2a 100644 (file)
@@ -1869,6 +1869,12 @@ int caseIgnoreFilter(
 
 #if UTF8MATCH
        value = ber_bvstr( UTF8normalize( ((struct berval *) assertValue)->bv_val, UTF8_CASEFOLD ) );
+       /* This usually happens if filter contains bad UTF8 */
+       if( value == NULL ) {
+               keys = ch_malloc( sizeof( struct berval * ) );
+               keys[0] = NULL;
+               return LDAP_SUCCESS;
+       }
 #else
        value = ber_bvdup( (struct berval *) assertValue );
        ldap_pvt_str2upper( value->bv_val );