compact-encoding
Advanced tools
Comparing version 2.5.0 to 2.5.1
@@ -138,2 +138,3 @@ const b = require('b4a') | ||
decode (state) { | ||
if (state.end - state.start < 4) throw new Error('Out of bounds') | ||
const view = new DataView(state.buffer.buffer, state.start + state.buffer.byteOffset, 4) | ||
@@ -156,2 +157,3 @@ const float = view.getFloat32(0, true) // little endian | ||
decode (state) { | ||
if (state.end - state.start < 8) throw new Error('Out of bounds') | ||
const view = new DataView(state.buffer.buffer, state.start + state.buffer.byteOffset, 8) | ||
@@ -256,3 +258,3 @@ const float = view.getFloat64(0, true) // little endian | ||
const s = b.toString(state.buffer, 'utf8', state.start, state.start += len) | ||
if (b.byteLength(s) !== len) throw new Error('Out of bounds') | ||
if (b.byteLength(s) !== len || state.start > state.end) throw new Error('Out of bounds') | ||
return s | ||
@@ -259,0 +261,0 @@ } |
{ | ||
"name": "compact-encoding", | ||
"version": "2.5.0", | ||
"version": "2.5.1", | ||
"description": "A series of compact encoding schemes for building small and fast parsers and serializers", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -212,3 +212,3 @@ const enc = require('./') | ||
t.exception(() => enc.uint32Array.decode(state)) | ||
t.exception(() => enc.uint32array.decode(state)) | ||
}) | ||
@@ -215,0 +215,0 @@ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
27722
641
0