Skip to content

Lack of handling on _requires_ack if this.store throws error leads to infinite this._message_identifier increment #260

Open
@elcreator

Description

@elcreator

https://github.com/eclipse/paho.mqtt.javascript/blob/be026e0305f0ae5ed100015df25bbd20fac0a41b/src/paho-mqtt.js#L1201
should be

 if (this._message_identifier >= this.maxMessageIdentifier) { 

because

			while(this._sentMessages[this._message_identifier] !== undefined) {
				this._message_identifier++;
			}

increments before this.store("Sent:", wireMessage); is called and this.store("Sent:", wireMessage); can throw an error, after which this._message_identifier remains incremented. Next time when this._requires_ack will be called it will be incremented again and this comparison will not work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions