Skip to content

fix: correct APDU buffer size for case 2 commands - #16

Merged
al3xwq merged 1 commit into
masterfrom
fix-win
Sep 22, 2026
Merged

al3xwq merged 1 commit into
masterfrom
fix-win

Conversation

@jeanpierrefortune

Copy link
Copy Markdown
Contributor

allocateBuffer() added the Lc byte even when dataIn was empty, producing a 6-byte APDU (header + Lc=00 + Le) instead of the expected 5-byte case 2 APDU. The extra trailing byte made ApduUtil::isCase4() report a case 4 command, which led the reader adapter to issue a spurious Get Response. Align the allocation with the Java reference implementation and add the missing unit test.

allocateBuffer() added the Lc byte even when dataIn was empty, producing a 6-byte APDU (header + Lc=00 + Le) instead of the expected 5-byte case 2 APDU. The extra trailing byte made ApduUtil::isCase4() report a case 4 command, which led the reader adapter to issue a spurious Get Response. Align the allocation with the Java reference implementation and add the missing unit test.
@sonarqubecloud

Copy link
Copy Markdown

@al3xwq
al3xwq merged commit 3b88de1 into master Sep 22, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants