diff options
author | Rich Trott <rtrott@gmail.com> | 2017-03-23 16:27:02 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2017-03-28 11:31:10 -0700 |
commit | 682573c11dcd88b7d13f929884437de8415e3fed (patch) | |
tree | 6949bb8c413e130102a42768f79593080d81cd59 /src | |
parent | a6f94942b0ff617e5788e26261e863f512d713e1 (diff) | |
download | android-node-v8-682573c11dcd88b7d13f929884437de8415e3fed.tar.gz android-node-v8-682573c11dcd88b7d13f929884437de8415e3fed.tar.bz2 android-node-v8-682573c11dcd88b7d13f929884437de8415e3fed.zip |
buffer: remove error for malformatted hex string
Remove error message when a hex string of an incorrect length is sent
to .write() or .fill().
PR-URL: https://github.com/nodejs/node/pull/12012
Fixes: https://github.com/nodejs/node/issues/3770
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/node_buffer.cc | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/src/node_buffer.cc b/src/node_buffer.cc index 04c0161edd..d8879094fa 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -615,9 +615,6 @@ void Fill(const FunctionCallbackInfo<Value>& args) { enc == UTF8 ? str_obj->Utf8Length() : enc == UCS2 ? str_obj->Length() * sizeof(uint16_t) : str_obj->Length(); - if (enc == HEX && str_length % 2 != 0) - return env->ThrowTypeError("Invalid hex string"); - if (str_length == 0) return; @@ -685,9 +682,6 @@ void StringWrite(const FunctionCallbackInfo<Value>& args) { Local<String> str = args[0]->ToString(env->isolate()); - if (encoding == HEX && str->Length() % 2 != 0) - return env->ThrowTypeError("Invalid hex string"); - size_t offset; size_t max_length; |