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

fix bug where responses are truncated under certain circumstances #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

swissbit-csteuer
Copy link

I had to close #72 and open this PR instead because the old PR was tracking our master branch.

Please see the comments in #72 for details about this PR.

If a SGList has multiple write buffers, SGList#readInto
should iterate through all write buffers and
read the remaining bytes into the destination buffer
until len bytes have been read, or no more bytes remain.
Before this fix, SGList#readInto stopped iterating through the
write buffers at the first write buffer that had no remaining bytes.
However, it can happen that an empty write buffer is between
two write buffers with remaining bytes:

WPTR_BUF -> buffer_x   (remaining: 10)
            buffer_x+1 (remaining:  0)
            buffer_x+2 (remaining: 10)

In that case, the bytes in buffer_x+2 are not read
and the applet returns a truncated response (e.g. when generating a keypair)
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.

1 participant