There appears to be an operator-precedence bug when assigning cfg->repeat_delay. The floating-point value is currently cast to int before being divided by 1000000, which can cause an integer overflow for values greater than about 2000 seconds.
The code at this lines should add parentheses so that the division is performed before the cast:
https://github.com/eclipse-mosquitto/mosquitto/blame/6aaba32614eb1160ddbfeafd616f9f67e7914a41/client/client_shared.c#L1047
There appears to be an operator-precedence bug when assigning
cfg->repeat_delay. The floating-point value is currently cast tointbefore being divided by 1000000, which can cause an integer overflow for values greater than about 2000 seconds.The code at this lines should add parentheses so that the division is performed before the cast:
https://github.com/eclipse-mosquitto/mosquitto/blame/6aaba32614eb1160ddbfeafd616f9f67e7914a41/client/client_shared.c#L1047