Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix minor time-of-check vs time-of-use pointer issues #40128

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/crypto/crypto_context.cc
Expand Up @@ -1114,7 +1114,7 @@ int SecureContext::TicketKeyCallback(SSL* ssl,
return -1;
}

argv[2] = env != 0 ? v8::True(env->isolate()) : v8::False(env->isolate());
argv[2] = v8::True(env->isolate());
kokke marked this conversation as resolved.
Show resolved Hide resolved

Local<Value> ret;
if (!node::MakeCallback(
Expand Down
6 changes: 5 additions & 1 deletion src/udp_wrap.cc
Expand Up @@ -367,13 +367,17 @@ void UDPWrap::Disconnect(const FunctionCallbackInfo<Value>& args) {
#define X(name, fn) \
void UDPWrap::name(const FunctionCallbackInfo<Value>& args) { \
UDPWrap* wrap = Unwrap<UDPWrap>(args.Holder()); \
if (wrap == nullptr) { \
args.GetReturnValue().Set(UV_EBADF); \
return; \
} \
Environment* env = wrap->env(); \
CHECK_EQ(args.Length(), 1); \
int flag; \
if (!args[0]->Int32Value(env->context()).To(&flag)) { \
return; \
} \
int err = wrap == nullptr ? UV_EBADF : fn(&wrap->handle_, flag); \
int err = fn(&wrap->handle_, flag); \
args.GetReturnValue().Set(err); \
}

Expand Down