mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
src: fix time-of-use vs time-of-check "bugs"
Refs: https://github.com/nodejs/node/pull/40128 PR-URL: https://github.com/nodejs/node/pull/40128 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
afb4ad6135
commit
b66c2e150c
2 files changed
+6
-2
No files matched your search
@@ -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());
|
||||
|
||||
Local<Value> ret;
|
||||
if (!node::MakeCallback(
|
||||
|
||||
+5
-1
@@ -371,13 +371,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); \
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user