Skip to content

Commit

Permalink
Fix improper size passed in memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
Sampson Gao committed Feb 1, 2017
1 parent 50aeb10 commit ae24137
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/node_jsvmapi.cc
Expand Up @@ -1346,7 +1346,7 @@ napi_status napi_get_string_from_value(napi_env e,
v8::String::Utf8Value str(v8impl::V8LocalValueFromJsValue(v));
int len = str.length();
if (buf_size > len) {
memcpy(buf, *str, len);
memcpy(buf, *str, len + 1);
*result = 0;
} else {
memcpy(buf, *str, buf_size - 1);
Expand Down

0 comments on commit ae24137

Please sign in to comment.