[jboss-osgi-issues] [JBoss JIRA] (JBOSGI-780) ManifestBuilder does not work on windows if line has 511 bytes
Martin Basovnik (JIRA)
issues at jboss.org
Mon Jun 22 10:15:05 EDT 2015
Martin Basovnik created JBOSGI-780:
--------------------------------------
Summary: ManifestBuilder does not work on windows if line has 511 bytes
Key: JBOSGI-780
URL: https://issues.jboss.org/browse/JBOSGI-780
Project: JBoss OSGi
Issue Type: Bug
Components: other
Environment: windows
Reporter: Martin Basovnik
Windows lines end with {{CRLF}} ({{\r\n}}). Method {{org.jboss.osgi.metadata.ManifestBuilder.getManifest()}} does not count with this fact. If a line has exactly {{(n*512)-1}} bytes + {{CRLF}} then method {{Manifest#read}} will throw {{IOException}} and the building of manifest will fail.
The following line will crop byte {{\n}}:
{code:java}
byte[] lbuf = new byte[512];
attr.read(fis, lbuf);
{code}
and then the following condition will fail because the value is {{\r}}.
{code:java}
if (lbuf[--len] != '\n') {
throw new IOException("manifest line too long");
}
{code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
More information about the jboss-osgi-issues
mailing list