mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

neil_a_wilson
04.08.2007 000ca75b200b41f9560983be52756878f7acdc42
Fix a bug in the MakeLDIF tool in which it is possible to attempt to access a
slot beyond the end of the last name array when processing gets to the point at
which it reaches the end of the first and last name lists simultaneously. In
that case, the first name counter was being reset but the last name counter was
not.

OpenDS Issue Number: 1482
2 files modified
7 ■■■■■ changed files
opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/MakeLDIF.java 4 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/TemplateFile.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/MakeLDIF.java
@@ -346,7 +346,7 @@
    {
      int    msgID   = MSGID_MAKELDIF_ERROR_WRITING_LDIF;
      String message = getMessage(msgID, ldifFile.getValue(),
                                  String.valueOf(e));
                                  stackTraceToSingleLineString(e));
      System.err.println(wrapText(message, MAX_LINE_WIDTH));
      return 1;
    }
@@ -402,7 +402,7 @@
    {
      int    msgID   = MSGID_MAKELDIF_CANNOT_WRITE_ENTRY;
      String message = getMessage(msgID, String.valueOf(entry.getDN()),
                                  String.valueOf(e));
                                  stackTraceToSingleLineString(e));
      throw new MakeLDIFException(msgID, message, e);
    }
  }
opendj-sdk/opends/src/server/org/opends/server/tools/makeldif/TemplateFile.java
@@ -530,7 +530,8 @@
        }
      }
    }
    else if (lastNameIndex >= lastNames.length)
    if (lastNameIndex >= lastNames.length)
    {
      // We're at the end of the last name list, so start over.  If the last
      // name list is larger than the first name list, then we'll also need to