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: #42103
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Filip Skokan <panva.ip@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
  • Loading branch information
tniessen authored and danielleadams committed Apr 24, 2022
1 parent e77a7cf commit 4244b1a
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 4244b1a

Please sign in to comment.