Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(317)

Unified Diff: net/quic/crypto/p256_key_exchange_nss.cc

Issue 761903003: Update from https://crrev.com/306655 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/crypto_utils.cc ('k') | net/quic/crypto/quic_crypto_server_config.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/p256_key_exchange_nss.cc
diff --git a/net/quic/crypto/p256_key_exchange_nss.cc b/net/quic/crypto/p256_key_exchange_nss.cc
index 73aa03d238116cfecbadf7703f9efe93079c6a45..3296a6f566b8b34005a993b2c77ee44c7c624f17 100644
--- a/net/quic/crypto/p256_key_exchange_nss.cc
+++ b/net/quic/crypto/p256_key_exchange_nss.cc
@@ -5,6 +5,7 @@
#include "net/quic/crypto/p256_key_exchange.h"
#include "base/logging.h"
+#include "base/numerics/safe_conversions.h"
#include "base/sys_byteorder.h"
using base::StringPiece;
@@ -131,7 +132,7 @@ string P256KeyExchange::NewPrivateKey() {
}
// TODO(thaidn): determine how large encrypted private key can be
- uint16 private_key_size = private_key.size();
+ uint16 private_key_size = base::checked_cast<uint16>(private_key.size());
const size_t result_size = sizeof(private_key_size) +
private_key_size +
public_key.size();
« no previous file with comments | « net/quic/crypto/crypto_utils.cc ('k') | net/quic/crypto/quic_crypto_server_config.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698