mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Fix clang-tidy bugprone-misplaced-widening-cast warnings
This commit is contained in:
parent
184757b3db
commit
b3de432ef2
2 changed files with 4 additions and 0 deletions
|
@ -7,4 +7,5 @@ Checks: [-*,
|
|||
bugprone-macro-parentheses,
|
||||
bugprone-multi-level-implicit-pointer-conversion,
|
||||
bugprone-inc-dec-in-conditions,
|
||||
bugprone-misplaced-widening-cast,
|
||||
]
|
||||
|
|
|
@ -110,7 +110,10 @@ RecordValPtr X509::ParseCertificate(X509Val* cert_val, file_analysis::File* f) {
|
|||
auto pX509Cert = make_intrusive<RecordVal>(BifType::Record::X509::Certificate);
|
||||
BIO* bio = BIO_new(BIO_s_mem());
|
||||
|
||||
// The cast here is intentional to force it into a specific version of Assign()
|
||||
// NOLINTNEXTLINE(bugprone-misplaced-widening-cast)
|
||||
pX509Cert->Assign(0, static_cast<uint64_t>(X509_get_version(ssl_cert) + 1));
|
||||
|
||||
i2a_ASN1_INTEGER(bio, X509_get_serialNumber(ssl_cert));
|
||||
int len = BIO_read(bio, buf, sizeof(buf));
|
||||
pX509Cert->Assign(1, make_intrusive<StringVal>(len, buf));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue