]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9935 slapd UTF8StringValidate: fix read past end of string
authorHoward Chu <hyc@openldap.org>
Thu, 20 Oct 2022 11:20:00 +0000 (12:20 +0100)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 25 Oct 2022 16:05:53 +0000 (16:05 +0000)
Harmless, length check at end of routine would have returned an
error anyway.

servers/slapd/schema_init.c

index d753936d083b52b54f3991df2821baa8c4b93ed6..456404382603582474a9adc17908f115b07d7f85 100644 (file)
@@ -1823,6 +1823,8 @@ UTF8StringValidate(
        for( ; u < end; u += len ) {
                /* get the length indicated by the first byte */
                len = LDAP_UTF8_CHARLEN2( u, len );
+               if ( u + len > end )
+                       return LDAP_INVALID_SYNTAX;
 
                /* very basic checks */
                switch( len ) {