-
Notifications
You must be signed in to change notification settings - Fork 278
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
Possible undefined behaviour/bad memory access after reconnect #150
Comments
Signed-off-by: Rafael Silva <[email protected]>
Signed-off-by: Rafael Silva <[email protected]>
Yeah, this really was an odd choice -- you've just gotten disconnected from the broker, what makes you so sure that your next reconnection, likely just seconds afterwards, will succeed? The reconnect_callback caller should've been able to deal with failures, without needing the callback itself to block until success. Wonder if it'll be as simple as modifying the callback to return a bool and then an early return in |
Like i said i already provided a fix, tested and working on real world application |
Signed-off-by: Rafael Silva <[email protected]>
If within the reconnect callback something fails, and the function returns without correctly initializing the socket and calling connect, the sync continues as if nothing wrong happened, in cases where the socket initialization failed this could mean bad memory accesses in
recv
A fix is included in #149
The text was updated successfully, but these errors were encountered: