Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

No error event connecting to broker not supporting mqtt5 #993

Closed
evlach opened this issue Sep 23, 2019 · 0 comments · Fixed by mqttjs/mqtt-packet#100
Closed

No error event connecting to broker not supporting mqtt5 #993

evlach opened this issue Sep 23, 2019 · 0 comments · Fixed by mqttjs/mqtt-packet#100

Comments

@evlach
Copy link

evlach commented Sep 23, 2019

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

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant