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

Retrying is broken in Generic_Write. #7

Open
Rombobeorn opened this issue Oct 2, 2022 · 0 comments
Open

Retrying is broken in Generic_Write. #7

Rombobeorn opened this issue Oct 2, 2022 · 0 comments

Comments

@Rombobeorn
Copy link

POSIX.IO.Generic_Write tries to write repeatedly, but will break if it doesn't get to write the whole amount in the first attempt.

If the first attempt consumes less than half of the data, then Generic_Write sets the size too small in the second attempt, because it subtracts the written amount twice: first on line 485, and then again on line 481 in the next iteration.

If the first attempt consumes more than half of the data but not all of it, then there will be an integer underflow when To_Write < Written on line 481.

Change "To_Write - Written" to just "To_Write" on line 481, like this:
Blady-Com/florist@c485477

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

No branches or pull requests

1 participant