ITS#9935 slapd UTF8StringValidate: fix read past end of string

Harmless, length check at end of routine would have returned an
error anyway.
This commit is contained in:
Howard Chu 2022-10-20 12:20:00 +01:00
parent 04eded74fe
commit 3991a0d191

View 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 ) {