Skip to content

Commit

Permalink
src: do not ignore return value of BIO_reset
Browse files Browse the repository at this point in the history
The USE macro indicates that a value is intentionally ignored. Instead,
CHECK that the function succeeds.

PR-URL: nodejs#42103
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Filip Skokan <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Darshan Sen <[email protected]>
  • Loading branch information
tniessen authored and xtx1130 committed Apr 25, 2022
1 parent 0a4c9d3 commit 65b998a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/crypto/crypto_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ Local<Value> ToV8Value(Environment* env, const BIOPointer& bio) {
mem->data,
NewStringType::kNormal,
mem->length);
USE(BIO_reset(bio.get()));
CHECK_EQ(BIO_reset(bio.get()), 1);
return ret.FromMaybe(Local<Value>());
}

Expand Down Expand Up @@ -919,7 +919,7 @@ v8::MaybeLocal<v8::Value> GetSubjectAltNameString(
CHECK_NOT_NULL(ext);

if (!SafeX509SubjectAltNamePrint(bio, ext)) {
USE(BIO_reset(bio.get()));
CHECK_EQ(BIO_reset(bio.get()), 1);
return v8::Null(env->isolate());
}

Expand All @@ -938,7 +938,7 @@ v8::MaybeLocal<v8::Value> GetInfoAccessString(
CHECK_NOT_NULL(ext);

if (!SafeX509InfoAccessPrint(bio, ext)) {
USE(BIO_reset(bio.get()));
CHECK_EQ(BIO_reset(bio.get()), 1);
return v8::Null(env->isolate());
}

Expand All @@ -955,7 +955,7 @@ MaybeLocal<Value> GetIssuerString(
issuer_name,
0,
kX509NameFlagsMultiline) <= 0) {
USE(BIO_reset(bio.get()));
CHECK_EQ(BIO_reset(bio.get()), 1);
return Undefined(env->isolate());
}

Expand All @@ -971,7 +971,7 @@ MaybeLocal<Value> GetSubject(
X509_get_subject_name(cert),
0,
kX509NameFlagsMultiline) <= 0) {
USE(BIO_reset(bio.get()));
CHECK_EQ(BIO_reset(bio.get()), 1);
return Undefined(env->isolate());
}

Expand Down

0 comments on commit 65b998a

Please sign in to comment.