[jboss-jira] [JBoss JIRA] (ELY-1048) Coverity, ignoring number of bytes read

Martin Choma (JIRA) issues at jboss.org
Mon Apr 3 03:53:00 EDT 2017


Martin Choma created ELY-1048:
---------------------------------

             Summary: Coverity, ignoring number of bytes read
                 Key: ELY-1048
                 URL: https://issues.jboss.org/browse/ELY-1048
             Project: WildFly Elytron
          Issue Type: Bug
            Reporter: Martin Choma
            Assignee: Darran Lofthouse


Coverity found error handling of reading stream is not sufficient. There is no check if number of actual read bytes match number of expected read bytes .

{code:java|title=KeyStoreCredentialStore.java}
        private byte[] readBytes(ObjectInputStream ois) throws IOException {
            int len = ois.readInt();
            byte[] data = new byte[len];
            ois.read(data, 0, len);
            return data;
        }
{code}

[1] https://scan7.coverity.com/reports.htm#v23632/p11778/fileInstanceId=12563831&defectInstanceId=2991439&mergedDefectId=1422737



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)


More information about the jboss-jira mailing list