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 aec7ae2

Browse filesBrowse files
sam-githubMylesBorins
authored andcommitted
src: add SafeGetenv() to internal API
Allow it to be used anywhere in src/ that env variables with security implications are accessed. PR-URL: #11006 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent f2e97f8 commit aec7ae2
Copy full SHA for aec7ae2

File tree

Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-1
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ Local<Value> UVException(Isolate* isolate,
945945

946946

947947
// Look up environment variable unless running as setuid root.
948-
inline bool SafeGetenv(const char* key, std::string* text) {
948+
bool SafeGetenv(const char* key, std::string* text) {
949949
#ifndef _WIN32
950950
// TODO(bnoordhuis) Should perhaps also check whether getauxval(AT_SECURE)
951951
// is non-zero on Linux.
Collapse file

‎src/node_internals.h‎

Copy file name to clipboardExpand all lines: src/node_internals.h
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ void RegisterSignalHandler(int signal,
112112
bool reset_handler = false);
113113
#endif
114114

115+
bool SafeGetenv(const char* key, std::string* text);
116+
115117
template <typename T, size_t N>
116118
constexpr size_t arraysize(const T(&)[N]) { return N; }
117119

0 commit comments

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