You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in the callback_mqtt function in websockets.c, that causes a crash of the mosquitto broker on Windows when a client closes its websocket connection.
if((int)mosq->sock > 0){
or if(mosq->sock != INVALID_SOCKET){
A socket on Windows is an unsigned int, so this test succeeds even when the value is INVALID_SOCKET.
This invalid test causes the HASH_DELETE to be called again when the socket is already closed. This causes the crash. After changing the code the crash no longer happens.
Some extra info:
We use mosquitto version 1.5.5 and libwebsockets 3.0.1
The text was updated successfully, but these errors were encountered:
There is a bug in the callback_mqtt function in websockets.c, that causes a crash of the mosquitto broker on Windows when a client closes its websocket connection.
mosquitto/src/websockets.c
Line 249 in 19fbbd8
if((int)mosq->sock > 0){
or
if(mosq->sock != INVALID_SOCKET){
A socket on Windows is an unsigned int, so this test succeeds even when the value is INVALID_SOCKET.
This invalid test causes the HASH_DELETE to be called again when the socket is already closed. This causes the crash. After changing the code the crash no longer happens.
Some extra info:
We use mosquitto version 1.5.5 and libwebsockets 3.0.1
The text was updated successfully, but these errors were encountered: