summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrevor Norris <trev.norris@gmail.com>2016-04-06 16:04:40 -0600
committerTrevor Norris <trev.norris@gmail.com>2016-04-08 10:59:00 -0600
commit9d94cc584e50066150b4d2819eb3e7657a0edb4a (patch)
tree54b3b3ef24483cd00b98000db6c21374433c06e2 /src
parent945454894bf191e3d1753647fa2d574f4692f5e3 (diff)
downloadandroid-node-v8-9d94cc584e50066150b4d2819eb3e7657a0edb4a.tar.gz
android-node-v8-9d94cc584e50066150b4d2819eb3e7657a0edb4a.tar.bz2
android-node-v8-9d94cc584e50066150b4d2819eb3e7657a0edb4a.zip
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')
-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;