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

ManifestBuilder does not work on windows if line has 511 bytes

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Done
    • None
    • JBossOSGI 2.3.1
    • other
    • None

    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");
      }
      

      Attachments

        Activity

          People

            arcivanov_jira Arcadiy Ivanov (Inactive)
            mbasovni Martin Basovnik (Inactive)
            Archiver:
            samahaja@redhat.com Sagar Mahajan

            Dates

              Created:
              Updated:
              Resolved:
              Archived:

              PagerDuty