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

race condition waiting for "0644" #1

Open
bsilvern opened this issue May 1, 2019 · 0 comments
Open

race condition waiting for "0644" #1

bsilvern opened this issue May 1, 2019 · 0 comments

Comments

@bsilvern
Copy link

bsilvern commented May 1, 2019

There is a race condition in CompleteFlow.java at:

// read '0644 '
in.read(buf, 0, 5);

…if fewer than 5 bytes have arrived at that time as the read function does not block. Replacing the above code with the following corrects this:

int bytes_read = 0;
while (bytes_read < 5)
  bytes_read += in.read(buf, 0, 5-bytes_read);
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