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

Possibility of negative value for timeout variable of the pselect inside mosquitto_loop #329

Closed
Dollars opened this issue Dec 5, 2016 · 1 comment

Comments

@Dollars
Copy link

Dollars commented Dec 5, 2016

If you make a sleep in a loop before calling mosquitto_loop it is possible that now is greater than mosq->next_msg_out which result in a negative value for timeout. Then, pselect will fail with a EINVAL error. Should'nt we add timeout = timeout < 0 ? 0 : timeout inside the if block ?

ralight added a commit that referenced this issue Dec 8, 2016
@ralight ralight added this to the fixes-next milestone Dec 8, 2016
@ralight
Copy link
Contributor

ralight commented Dec 8, 2016

Thanks, you're quite right. I've fixed this on the fixes branch.

@ralight ralight closed this as completed Dec 8, 2016
ralight added a commit that referenced this issue Feb 20, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Aug 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants