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] fix potentially infinite loop #8

Merged
merged 2 commits into from May 10, 2016

Conversation

Projects
None yet
2 participants
@vanadium23
Copy link

vanadium23 commented May 10, 2016

So here we goes guys. If you read from socket, than there is a chance that combination of two bytes ('\r\n') will be stored in two different buffers and client will go to infinite loop.
So I write a small fix, if mem_view has less than two elements, than stop loop.

Example stack_trace:
recv_from(pd, 'a very long message\r')
recv_from(pd, '\n')
recv_from(pd, ....)

Ivan Chernov
[Fix] fix potentially infinite loop
So here we goes guys. If you read from socket, than
there is a chance that combination of two bytes ('\r\n')
will be stored in two different buffers and client will
go to infinite loop.
@menezes-

This comment has been minimized.

Copy link
Owner

menezes- commented May 10, 2016

Hi Ivan, thanks for the pull request! Could you write a unit test for this?

@vanadium23

This comment has been minimized.

Copy link

vanadium23 commented May 10, 2016

@menezes- thanks for quick response. I've added unit test.

@menezes-

This comment has been minimized.

Copy link
Owner

menezes- commented May 10, 2016

@vanadium23 everything seems ok! Thanks for the contribution!

@menezes- menezes- merged commit 334d61b into menezes-:master May 10, 2016

@vanadium23 vanadium23 deleted the vanadium23:f/fix_infinite_loop branch May 10, 2016

@vanadium23

This comment has been minimized.

Copy link

vanadium23 commented May 10, 2016

@menezes- can you dump this on pypi, please?

@menezes-

This comment has been minimized.

Copy link
Owner

menezes- commented May 10, 2016

Yes! It'll be on pypi by tomorrow at most, I'll reply here to notify you
Em 10/05/2016 16:40, "Ivan Chernoff" notifications@github.com escreveu:

@menezes- https://github.com/menezes- can you dump this on pypi, please?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
https://github.com/menezes-/pystalkd/pull/8#issuecomment-218267545

@menezes-

This comment has been minimized.

Copy link
Owner

menezes- commented May 11, 2016

@vanadium23 it's on pypi now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment