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 incorrect recv() size calculation in libkrad #471

Closed
wants to merge 1 commit into from

Conversation

npmccallum
Copy link
Contributor

Before this patch libkrad would always subtract the existing buffer
length from pktlen before passing it to recv(). However, in the case of
stream sockets, this is incorrect since krad_packet_bytes_needed()
already performs this calculation. This would lead to a case where the
existing buffer length was getting subtracted twice, causing integer
underflow on the len parameter to recv().

Before this patch libkrad would always subtract the existing buffer
length from pktlen before passing it to recv(). However, in the case of
stream sockets, this is incorrect since krad_packet_bytes_needed()
already performs this calculation. This would lead to a case where the
existing buffer length was getting subtracted twice, causing integer
underflow on the len parameter to recv().
@npmccallum
Copy link
Contributor Author

In case it isn't obvious, I'd like this applied to all minor releases as well.

@greghudson
Copy link
Member

Pushed to master as c969e8a

@greghudson greghudson closed this Jun 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants