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

Implement data manipulation methods for dataview #218

Closed
wants to merge 1 commit into from

Conversation

romandev
Copy link
Contributor

This change implements additional methods for manipulating data in the
dataview object. This change includes the following things:

  • Get/Set${type} methods to manipulate data
  • Tests for the methods

@romandev
Copy link
Contributor Author

@mhdawson Could you please check this patch?

napi-inl.h Outdated

template <typename T>
inline T DataView::ReadData(size_t byteOffset) const {
if (byteOffset + sizeof(T) > _length) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this could overflow and let somebody read up to 7 bytes before _data. I'm not sure how an attacker could do anything useful with that, but it might be surprising.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I've addressed your comment.

Thanks.

This change implements additional methods for manipulating data in the
dataview object. This change includes the following things:
  - Get/Set${type} methods to manipulate data
  - Tests for the methods
@mhdawson
Copy link
Member

@romandev just back from being out for a week and still catching up. Will try and review later this week.

@romandev
Copy link
Contributor Author

@mhdawson Gentle ping.

@mhdawson
Copy link
Member

@romandev thanks for the reminder, have been pretty busy and at a conference this week but will try to find time to take a look.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

mhdawson pushed a commit that referenced this pull request Mar 1, 2018
This change implements additional methods for manipulating data in the
dataview object. This change includes the following things:
  - Get/Set${type} methods to manipulate data
  - Tests for the methods

PR-URL: #218
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
@mhdawson
Copy link
Member

mhdawson commented Mar 1, 2018

Landed as 9c4d321

@mhdawson mhdawson closed this Mar 1, 2018
kevindavies8 added a commit to kevindavies8/node-addon-api-Develop that referenced this pull request Aug 24, 2022
This change implements additional methods for manipulating data in the
dataview object. This change includes the following things:
  - Get/Set${type} methods to manipulate data
  - Tests for the methods

PR-URL: nodejs/node-addon-api#218
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Marlyfleitas added a commit to Marlyfleitas/node-api-addon-Development that referenced this pull request Aug 26, 2022
This change implements additional methods for manipulating data in the
dataview object. This change includes the following things:
  - Get/Set${type} methods to manipulate data
  - Tests for the methods

PR-URL: nodejs/node-addon-api#218
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
wroy7860 added a commit to wroy7860/addon-api-benchmark-node that referenced this pull request Sep 19, 2022
This change implements additional methods for manipulating data in the
dataview object. This change includes the following things:
  - Get/Set${type} methods to manipulate data
  - Tests for the methods

PR-URL: nodejs/node-addon-api#218
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
johnfrench3 pushed a commit to johnfrench3/node-addon-api-git that referenced this pull request Aug 11, 2023
This change implements additional methods for manipulating data in the
dataview object. This change includes the following things:
  - Get/Set${type} methods to manipulate data
  - Tests for the methods

PR-URL: nodejs/node-addon-api#218
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants