]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#9412 fix AVA_Sort on invalid RDN
authorHoward Chu <hyc@openldap.org>
Tue, 1 Dec 2020 18:32:35 +0000 (18:32 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 1 Dec 2020 19:04:54 +0000 (19:04 +0000)
servers/slapd/dn.c

index 210017a58992258cb79b9502f39c7a7b3072d207..414678a4d8f790c367555ba0be9f9f8c0fa3ebae 100644 (file)
@@ -233,6 +233,7 @@ AVA_Sort( LDAPRDN rdn, int nAVAs )
 {
        LDAPAVA *ava_i;
        int             i;
+       int             rc = LDAP_SUCCESS;
 
        assert( rdn != NULL );
 
@@ -250,7 +251,7 @@ AVA_Sort( LDAPRDN rdn, int nAVAs )
                        /* RFC4512 does not allow multiple AVAs
                         * with the same attribute type in RDN (ITS#5968) */
                        if ( a == 0 )
-                               return LDAP_INVALID_DN_SYNTAX;
+                               rc = LDAP_INVALID_DN_SYNTAX;
 
                        if ( a > 0 )
                                break;
@@ -259,7 +260,7 @@ AVA_Sort( LDAPRDN rdn, int nAVAs )
                }
                rdn[ j+1 ] = ava_i;
        }
-       return LDAP_SUCCESS;
+       return rc;
 }
 
 static int