ndb icon indicating copy to clipboard operation
ndb copied to clipboard

Buffer overflow error about socket in NddService received data over 8192

Open unadlib opened this issue 3 years ago • 1 comments

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 avatar Aug 11 '20 19:08 unadlib

@ak239 can you take a look at this PR to solve this issue: https://github.com/GoogleChromeLabs/ndb/pull/323

razorman8669 avatar Oct 16 '20 18:10 razorman8669