Skip to content

Integer overflow in mosquitto_pub #3736

Description

@scaiper

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: AvailableNo one has claimed responsibility for resolving this issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions