Uploaded image for project: 'JBoss OSGi'
  1. JBoss OSGi
  2. JBOSGI-780

ManifestBuilder does not work on windows if line has 511 bytes

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: JBossOSGI 2.3.1
    • Component/s: other
    • Labels:
      None
    • Environment:

      windows

      Description

      Lines on Windows OS end with CRLF (\r\n). Method org.jboss.osgi.metadata.ManifestBuilder.getManifest() does not count with this fact. If bytes.length == 511 then a line will have 513 bytes and method Manifest#read will throw IOException and the building of the manifest will fail.

      Reason:
      The following line will crop byte \n:

      byte[] lbuf = new byte[512];
      attr.read(fis, lbuf);
      

      and then the following condition will fail because the value of lbuf[--len] expression is '\r'.

      if (lbuf[--len] != '\n') {
                      throw new IOException("manifest line too long");
      }
      

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                arcivanov Arcadiy Ivanov
                Reporter:
                mbasovni Martin Basovnik
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: