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

Ilia Vassilev (JIRA) issues at jboss.org
Mon Apr 3 08:09:01 EDT 2017


     [ https://issues.jboss.org/browse/ELY-1048?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ilia Vassilev reassigned ELY-1048:
----------------------------------

    Assignee: Ilia Vassilev  (was: Darran Lofthouse)


> 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: Ilia Vassilev
>
> 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