Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Buffer overflow error about socket in NddService received data over 8192 #319

Open
unadlib opened this issue Aug 11, 2020 · 1 comment · May be fixed by #323
Open

Buffer overflow error about socket in NddService received data over 8192 #319

unadlib opened this issue Aug 11, 2020 · 1 comment · May be fixed by #323

Comments

@unadlib
Copy link

unadlib commented Aug 11, 2020

Steps to reproduce

Tell us about your environment:

  • ndb version: 1.1.5
  • Platform / OS version: macOS 10.14.3
  • Node.js version: 12.18.3

What steps will reproduce the problem?

SyntaxError: Unexpected end of JSON input

Please include code that reproduces the issue.

  1. run ndb with a big size cli args(over 8192B)

What is the expected result?

normal execution

What happens instead?

throw error

/usr/local/lib/node_modules/ndb/services/ndd_service.js:21
  throw error;
  ^

SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at Socket.<anonymous> (/usr/local/lib/node_modules/ndb/services/ndd_service.js:104:58)
    at Socket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:295:12)
    at readableAddChunk (_stream_readable.js:271:9)
    at Socket.Readable.push (_stream_readable.js:212:10)
    at Pipe.onStreamRead (internal/stream_base_commons.js:186:23)
@unadlib unadlib changed the title Buffer overflow error about socket in NddService received data over 8192B Buffer overflow error about socket in NddService received data over 8192 Aug 11, 2020
razorman8669 added a commit to razorman8669/ndb that referenced this issue Oct 10, 2020
This patch fixes NddService.server socker.on('data') so that it can handle large amounts of input without throwing `SyntaxError: Unexpected end of JSON input` errors.

Fixes GoogleChromeLabs#319
razorman8669 added a commit to razorman8669/ndb that referenced this issue Oct 10, 2020
This patch fixes NddService.server socker.on('data') so that it can handle large amounts of input without throwing `SyntaxError: Unexpected end of JSON input` errors.

Fixes GoogleChromeLabs#319
razorman8669 added a commit to razorman8669/ndb that referenced this issue Oct 10, 2020
This patch fixes NddService.server socker.on('data') so that it can handle large amounts of input without throwing `SyntaxError: Unexpected end of JSON input` errors.

Fixes GoogleChromeLabs#319
razorman8669 added a commit to razorman8669/ndb that referenced this issue Oct 10, 2020
This patch fixes NddService.server socker.on('data') so that it can handle large amounts of input without throwing `SyntaxError: Unexpected end of JSON input` errors.

Fixes GoogleChromeLabs#319
razorman8669 added a commit to razorman8669/ndb that referenced this issue Oct 10, 2020
This patch fixes NddService.server socker.on('data') so that it can handle large amounts of input without throwing `SyntaxError: Unexpected end of JSON input` errors.

Fixes GoogleChromeLabs#319
@razorman8669
Copy link

@ak239 can you take a look at this PR to solve this issue: #323

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants