mqtt-packet
Advanced tools
Comparing version 5.6.0 to 5.6.1
{ | ||
"name": "mqtt-packet", | ||
"version": "5.6.0", | ||
"version": "5.6.1", | ||
"description": "Parse and generate MQTT packets like a breeze", | ||
@@ -5,0 +5,0 @@ "main": "mqtt.js", |
@@ -268,2 +268,3 @@ 'use strict' | ||
if (this._pos >= packet.length) return this._emitError(new Error('Malformed Subscribe Payload')) | ||
qos = this._list.readUInt8(this._pos++) | ||
@@ -270,0 +271,0 @@ |
11
test.js
@@ -1171,2 +1171,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) { | ||
@@ -1173,0 +1184,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
75238
2426