Thanks to visit codestin.com
Credit goes to github.com

Skip to content

No error event connecting to broker not supporting mqtt5 #993

@evlach

Description

@evlach

No error event while trying to connect mqtt 3.0.0 client with using ´protocolVersion: 5´ to broker that does not support MQTT 5. Tested with Mosquitto 1.5. Here is the error: :

internal/buffer.js:70
    throw new ERR_BUFFER_OUT_OF_BOUNDS();
    ^

RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to access memory outside buffer bounds
    at boundsError (internal/buffer.js:70:11)
    at Buffer.readUInt8 (internal/buffer.js:238:5)
    at BufferList.<computed> [as readUInt8] (/home/evlach/code/streamsheets/node_modules/bl/bl.js:274:58)
    at Parser._parseVarByteNum (/home/evlach/code/streamsheets/node_modules/mqtt-packet/parser.js:523:26)
    at Parser._parseProperties (/home/evlach/code/streamsheets/node_modules/mqtt-packet/parser.js:584:21)
    at Parser._parseConnack (/home/evlach/code/streamsheets/node_modules/mqtt-packet/parser.js:248:27)
    at Parser._parsePayload (/home/evlach/code/streamsheets/node_modules/mqtt-packet/parser.js:87:14)
    at Parser.parse (/home/evlach/code/streamsheets/node_modules/mqtt-packet/parser.js:39:41)
    at Writable.writable._write (/home/evlach/code/streamsheets/node_modules/mqtt/lib/client.js:293:12)
    at doWrite (/home/evlach/code/streamsheets/node_modules/readable-stream/lib/_stream_writable.js:428:64)

Problem is that it is not possible to catch this error and try a different protocol version for example.

AB#9327638

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