Преглед изворни кода

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 година
родитељ
комит
0612f01283
1 измењених фајлова са 1 додато и 1 уклоњено
  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,