Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 037291e

Browse filesBrowse files
addaleaxMyles Borins
authored andcommitted
src: make sure Utf8Value always zero-terminates
Make sure dereferencing a `Utf8Value` instance always returns a zero-terminated string, even if the conversion to string failed. The corresponding bugfix in the master branch happened in 44a4032 (#6357). Ref: #6357 PR-URL: #7101 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
1 parent a31153c commit 037291e
Copy full SHA for 037291e

File tree

Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-0
lines changed
Open diff view settings
Collapse file

‎src/util.cc‎

Copy file name to clipboardExpand all lines: src/util.cc
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ namespace node {
55

66
Utf8Value::Utf8Value(v8::Isolate* isolate, v8::Local<v8::Value> value)
77
: length_(0), str_(str_st_) {
8+
// Make sure result is always zero-terminated, even if conversion to string
9+
// fails.
10+
str_st_[0] = '\0';
11+
812
if (value.IsEmpty())
913
return;
1014

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.