summaryrefslogtreecommitdiff
path: root/src/node_internals.h
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2016-04-06 16:04:40 -0600
committerJames M Snell <jasnell@gmail.com>2016-04-26 12:15:53 -0700
commit5b41230f678c9b08c274f91f2e5439c4c5446ae7 (patch)
tree9f76b4b7820bf5f0f6238d2d1c607ddcaddf7b1b /src/node_internals.h
parent4305a23600d0d44512477b90eebf873778ecd7ef (diff)
downloadnode-new-5b41230f678c9b08c274f91f2e5439c4c5446ae7.tar.gz
buffer: standardize array index check
ParseArrayIndex() was requesting a Uint32Value(), but assigning it to an in32_t. This caused slight differences in error message reported in edge cases of argument parsing. Fixed by getting the IntegerValue() before checking if the value is < 0. Added test of API that was affected. PR-URL: https://github.com/nodejs/node/pull/6084 Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_internals.h')
-rw-r--r--src/node_internals.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/node_internals.h b/src/node_internals.h
index efdc82e531..485ba18b3c 100644
--- a/src/node_internals.h
+++ b/src/node_internals.h
@@ -169,7 +169,7 @@ inline MUST_USE_RESULT bool ParseArrayIndex(v8::Local<v8::Value> arg,
return true;
}
- int32_t tmp_i = arg->Uint32Value();
+ int64_t tmp_i = arg->IntegerValue();
if (tmp_i < 0)
return false;