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 danielleadams committed Apr 21, 2022
1 parent f6741b1 commit 9998084
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 @@ -298,7 +298,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 @@ -951,7 +951,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 @@ -970,7 +970,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 @@ -987,7 +987,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 @@ -1003,7 +1003,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 9998084

Please sign in to comment.