浏览代码

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,