Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

child_process: fix parsing messages with splitted length field #56106

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update lib/internal/child_process/serialization.js
Co-authored-by: Luigi Pinca <[email protected]>
  • Loading branch information
MGorkov and lpinca authored Dec 13, 2024
commit a7ef03ad5e3a8931ca231c17635cb681f2e6c6c6
2 changes: 1 addition & 1 deletion lib/internal/child_process/serialization.js
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@ const advanced = {
*parseChannelMessages(channel, readData) {
if (readData.length === 0) return;

if (channel[kMessageBuffer].length && channel[kMessageBuffer][0].length < 4) {
if (channel[kMessageBufferSize] && channel[kMessageBuffer][0].length < 4) {
// Message length split into two buffers, so let's concatenate it.
channel[kMessageBuffer][0] = Buffer.concat([channel[kMessageBuffer][0], readData]);
} else {
Loading