Browse Source

Bug 630094 - (cov#15458) Fix deadcode issue in moddn code

In the moddn code that renames child entries, the for loop used to
rename the children can never be executed. Part of the condition
is that retval is 0, but retval will always be -1 the first time we
hit this loop. This only happens with subtree rename off, but it
should still be fixed.

The fix is to set retval to 0 at the prior to checking the condition
the first time.
Nathan Kinder 15 năm trước cách đây
mục cha
commit
0612f01283
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      ldap/servers/slapd/back-ldbm/ldbm_modrdn.c

+ 1 - 1
ldap/servers/slapd/back-ldbm/ldbm_modrdn.c

@@ -1578,7 +1578,7 @@ moddn_rename_children(
      */
     slapi_pblock_get( pb, SLAPI_OPERATION, &operation );
     opcsn = operation_get_csn (operation);
-    for (i=0; retval == 0 && child_entries[i] && child_entry_copies[i]; i++) {
+    for (i=0,retval=0; retval == 0 && child_entries[i] && child_entry_copies[i]; i++) {
         retval = moddn_rename_child_entry(ptxn, pb, li, child_entries[i],
                                          child_entry_copies[i], parentdncomps,
                                          newsuperiordns, newsuperiordncomps,