Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

comparing le + offset to file size in processReadBinary #16

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/net/pwendland/javacard/pki/isoapplet/IsoFileSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -701,10 +701,10 @@ public void processReadBinary(APDU apdu) {
* The host may request all the data (up to 256 Bytes) with Le=00, but the data might be smaller.
* This is a valid request; we have to send all the data (even if less than 256 Bytes).
*/
if((short) (le+offset) >= (short) fileData.length) {
le = (short)((short)(fileData.length) - offset);
short maxle = (short)(fileData.length - offset);
if(le > maxle) {
le = maxle;
}

apdu.setOutgoingLength(le);
apdu.sendBytesLong(fileData, offset, le);
}
Expand Down