]> git.sur5r.net Git - openldap/commitdiff
ITS#7608 promoted attrs must have valid ad_index
authorHoward Chu <hyc@openldap.org>
Mon, 27 May 2013 15:57:15 +0000 (08:57 -0700)
committerHoward Chu <hyc@openldap.org>
Mon, 27 May 2013 15:57:15 +0000 (08:57 -0700)
servers/slapd/ad.c

index d1e4868dd5527040daff3fa9e351879c228d070c..71ea438a27f23d3cd8cf70df8ab711b7b017eeb7 100644 (file)
@@ -844,6 +844,9 @@ undef_promote(
                        tmp->ad_next = NULL;
                        /* ad_cname was contiguous, no leak here */
                        tmp->ad_cname = nat->sat_cname;
+                       ldap_pvt_thread_mutex_lock( &ad_index_mutex );
+                       tmp->ad_index = ++ad_count;
+                       ldap_pvt_thread_mutex_unlock( &ad_index_mutex );
                        *n_ad = tmp;
                        n_ad = &tmp->ad_next;
                } else {