GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — buffer: fix copy() segfault with zero arguments by trevnorris · Pull Request #1520 · nodejs/node

Conversation

@trevnorris

@trevnorris trevnorris commented Apr 24, 2015

Copy link
Copy Markdown
Contributor

Buffer#copy() immediately does a ToObject() on the first argument before
it checks if it's even an Object. This causes
Object::HasIndexedPropertiesInExternalArrayData() to be run on nothing,
triggering the segfault. Instead run HasInstance() on the args Value.
Which will check if it's actually an Object, before checking if it
contains data.

Fixes: #1519

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@evanlucas

evanlucas commented Apr 24, 2015

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trevnorris
trevnorris force-pushed the buff-copy-segfault-fix branch from 66906c4 to cbb2d60 Compare April 24, 2015 16:58
@trevnorris
buffer: fix copy() segfault with zero arguments
2d7fb76
Buffer#copy() immediately does a ToObject() on the first argument before
it checks if it's even an Object. This causes
Object::HasIndexedPropertiesInExternalArrayData() to be run on nothing,
triggering the segfault. Instead run HasInstance() on the args Value.
Which will check if it's actually an Object, before checking if it
contains data.

Fixes: nodejs#1519
@trevnorris
trevnorris force-pushed the buff-copy-segfault-fix branch from cbb2d60 to 2d7fb76 Compare April 24, 2015 16:58
@mscdex mscdex added the buffer Issues and PRs related to the buffer subsystem. label Apr 24, 2015
trevnorris added a commit that referenced this pull request Apr 24, 2015
@trevnorris
buffer: fix copy() segfault with zero arguments
5404cbc
Buffer#copy() immediately does a ToObject() on the first argument before
it checks if it's even an Object. This causes
Object::HasIndexedPropertiesInExternalArrayData() to be run on nothing,
triggering the segfault. Instead run HasInstance() on the args Value.
Which will check if it's actually an Object, before checking if it
contains data.

Fixes: #1519
PR-URL: #1520
Reviewed-by: Evan Lucas <[email protected]>
@trevnorris

trevnorris commented Apr 24, 2015

Copy link
Copy Markdown
Contributor Author

Landed in 5404cbc.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@trevnorris trevnorris closed this Apr 24, 2015
@monsanto monsanto mentioned this pull request Apr 24, 2015
buffer: fix segfaults when this is not a Buffer. #1486
Closed
@trevnorris
trevnorris deleted the buff-copy-segfault-fix branch April 24, 2015 20:08
Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request Apr 29, 2015
@trevnorris @Fishrock123
buffer: fix copy() segfault with zero arguments
f049938
Buffer#copy() immediately does a ToObject() on the first argument before
it checks if it's even an Object. This causes
Object::HasIndexedPropertiesInExternalArrayData() to be run on nothing,
triggering the segfault. Instead run HasInstance() on the args Value.
Which will check if it's actually an Object, before checking if it
contains data.

Fixes: nodejs#1519
PR-URL: nodejs#1520
Reviewed-by: Evan Lucas <[email protected]>
@Fishrock123 Fishrock123 mentioned this pull request Apr 29, 2015
Forward port from v1.x #1559
Closed
Fishrock123 pushed a commit to Fishrock123/node that referenced this pull request Apr 30, 2015
@trevnorris @Fishrock123
buffer: fix copy() segfault with zero arguments
30fb284
Buffer#copy() immediately does a ToObject() on the first argument before
it checks if it's even an Object. This causes
Object::HasIndexedPropertiesInExternalArrayData() to be run on nothing,
triggering the segfault. Instead run HasInstance() on the args Value.
Which will check if it's actually an Object, before checking if it
contains data.

Fixes: nodejs#1519
PR-URL: nodejs#1520
PORT-PR-URL: nodejs#1559
Reviewed-by: Evan Lucas <[email protected]>
@rvagg rvagg mentioned this pull request May 2, 2015
Release proposal: v2.0.0 #1532
Closed
@Fishrock123 Fishrock123 mentioned this pull request May 14, 2015
Release proposal: v1.8.2 #1703
Closed
@snyk-bot snyk-bot mentioned this pull request Jul 28, 2021
[Snyk] Upgrade commander from 2.11.0 to 8.0.0 MaxMood96/node#4
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

buffer Issues and PRs related to the buffer subsystem.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@trevnorris @evanlucas @mscdex
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.