mqtt-packet
Advanced tools
Comparing version 6.1.1 to 6.1.2
{ | ||
"name": "mqtt-packet", | ||
"version": "6.1.1", | ||
"version": "6.1.2", | ||
"description": "Parse and generate MQTT packets like a breeze", | ||
@@ -5,0 +5,0 @@ "main": "mqtt.js", |
@@ -305,2 +305,3 @@ 'use strict' | ||
if (topic === null) return this._emitError(new Error('Cannot parse topic')) | ||
if (this._pos >= packet.length) return this._emitError(new Error('Malformed Subscribe Payload')) | ||
@@ -307,0 +308,0 @@ options = this._parseByte() |
11
test.js
@@ -1842,2 +1842,13 @@ 'use strict' | ||
// When a Subscribe packet contains a topic_filter and the given | ||
// length is topic_filter.length + 1 then the last byte (requested QoS) is interpreted as topic_filter | ||
// reading the requested_qos at the end causes 'Index out of range' read | ||
testParseError('Malformed Subscribe Payload', Buffer.from([ | ||
130, 14, // subscribe header and remaining length | ||
0, 123, // packet ID | ||
0, 10, // topic filter length | ||
104, 105, 106, 107, 108, 47, 109, 110, 111, // topic filter with length of 9 bytes | ||
0 // requested QoS | ||
])) | ||
test('stops parsing after first error', function (t) { | ||
@@ -1844,0 +1855,0 @@ t.plan(4) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
123321
3942