Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2022-03-01 19:21:18 +0300
committerGitHub <noreply@github.com>2022-03-01 19:21:18 +0300
commitef30a226ce65c002aa93e233f05d264be453ef84 (patch)
tree8ea30613238eb61a5aa70be4fe1219eb2accdaf8 /src/crypto
parenta9c0689786591dc45d319d9e3ae8d42e1b4594a7 (diff)
src: remove dead code in AddFingerprintDigest
This function is never called with md_size == 0, and it would make no sense to do so in the future either. PR-URL: https://github.com/nodejs/node/pull/42145 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com>
Diffstat (limited to 'src/crypto')
-rw-r--r--src/crypto/crypto_common.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/crypto/crypto_common.cc b/src/crypto/crypto_common.cc
index 1e0fa4f0661..2739b84d6c7 100644
--- a/src/crypto/crypto_common.cc
+++ b/src/crypto/crypto_common.cc
@@ -431,11 +431,8 @@ void AddFingerprintDigest(
fingerprint[(3*i)+2] = ':';
}
- if (md_size > 0) {
- fingerprint[(3*(md_size-1))+2] = '\0';
- } else {
- fingerprint[0] = '\0';
- }
+ DCHECK_GT(md_size, 0);
+ fingerprint[(3 * (md_size - 1)) + 2] = '\0';
}
template <const char* (*nid2string)(int nid)>