Skip to content

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