Socket
Socket
Sign inDemoInstall

socket.io-parser

Package Overview
Dependencies
3
Maintainers
2
Versions
53
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.2.0 to 4.2.1

12

build/cjs/binary.js

@@ -64,4 +64,12 @@ "use strict";

return data;
if (data && data._placeholder) {
return buffers[data.num]; // appropriate buffer (should be natural order anyway)
if (data && data._placeholder === true) {
const isIndexValid = typeof data.num === "number" &&
data.num >= 0 &&
data.num < buffers.length;
if (isIndexValid) {
return buffers[data.num]; // appropriate buffer (should be natural order anyway)
}
else {
throw new Error("illegal attachments");
}
}

@@ -68,0 +76,0 @@ else if (Array.isArray(data)) {

@@ -120,2 +120,5 @@ "use strict";

if (typeof obj === "string") {
if (this.reconstructor) {
throw new Error("got plaintext data when reconstructing a packet");
}
packet = this.decodeString(obj);

@@ -122,0 +125,0 @@ if (packet.type === PacketType.BINARY_EVENT ||

@@ -59,4 +59,12 @@ import { isBinary } from "./is-binary.js";

return data;
if (data && data._placeholder) {
return buffers[data.num]; // appropriate buffer (should be natural order anyway)
if (data && data._placeholder === true) {
const isIndexValid = typeof data.num === "number" &&
data.num >= 0 &&
data.num < buffers.length;
if (isIndexValid) {
return buffers[data.num]; // appropriate buffer (should be natural order anyway)
}
else {
throw new Error("illegal attachments");
}
}

@@ -63,0 +71,0 @@ else if (Array.isArray(data)) {

@@ -116,2 +116,5 @@ import { Emitter } from "@socket.io/component-emitter";

if (typeof obj === "string") {
if (this.reconstructor) {
throw new Error("got plaintext data when reconstructing a packet");
}
packet = this.decodeString(obj);

@@ -118,0 +121,0 @@ if (packet.type === PacketType.BINARY_EVENT ||

@@ -59,4 +59,12 @@ import { isBinary } from "./is-binary.js";

return data;
if (data && data._placeholder) {
return buffers[data.num]; // appropriate buffer (should be natural order anyway)
if (data && data._placeholder === true) {
const isIndexValid = typeof data.num === "number" &&
data.num >= 0 &&
data.num < buffers.length;
if (isIndexValid) {
return buffers[data.num]; // appropriate buffer (should be natural order anyway)
}
else {
throw new Error("illegal attachments");
}
}

@@ -63,0 +71,0 @@ else if (Array.isArray(data)) {

@@ -112,2 +112,5 @@ import { Emitter } from "@socket.io/component-emitter";

if (typeof obj === "string") {
if (this.reconstructor) {
throw new Error("got plaintext data when reconstructing a packet");
}
packet = this.decodeString(obj);

@@ -114,0 +117,0 @@ if (packet.type === PacketType.BINARY_EVENT ||

2

package.json
{
"name": "socket.io-parser",
"version": "4.2.0",
"version": "4.2.1",
"description": "socket.io protocol parser",

@@ -5,0 +5,0 @@ "repository": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc