]
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=12563...