Skip to content

Commit 5632d1f

Browse files
committed
fixup! Fix in more locations
1 parent 2bd18e5 commit 5632d1f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/crypto/crypto_x509.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ MaybeLocal<Value> ToV8Value(Local<Context> context, BIOPointer&& bio) {
106106
if (!bio) [[unlikely]]
107107
return {};
108108
BUF_MEM* mem = bio;
109+
if (!mem) [[unlikely]]
110+
return {};
109111
Local<Value> ret;
110112
if (!String::NewFromUtf8(Isolate::GetCurrent(),
111113
mem->data,
@@ -120,6 +122,8 @@ MaybeLocal<Value> ToV8Value(Local<Context> context, const BIOPointer& bio) {
120122
if (!bio) [[unlikely]]
121123
return {};
122124
BUF_MEM* mem = bio;
125+
if (!mem) [[unlikely]]
126+
return {};
123127
Local<Value> ret;
124128
if (!String::NewFromUtf8(Isolate::GetCurrent(),
125129
mem->data,
@@ -134,6 +138,8 @@ MaybeLocal<Value> ToBuffer(Environment* env, BIOPointer* bio) {
134138
if (bio == nullptr || !*bio) [[unlikely]]
135139
return {};
136140
BUF_MEM* mem = *bio;
141+
if (!mem) [[unlikely]]
142+
return {};
137143
#ifdef V8_ENABLE_SANDBOX
138144
// If the v8 sandbox is enabled, then all array buffers must be allocated
139145
// via the isolate. External buffers are not allowed. So, instead of wrapping

0 commit comments

Comments
 (0)