Index: content/common/ssl_status_serialization.cc |
diff --git a/content/common/ssl_status_serialization.cc b/content/common/ssl_status_serialization.cc |
index 26cb1cdc00cc8e2aa6ac9551aa25e715ba453fc8..5800f265fb1e58f9a2a3edb16c2b649254d25d70 100644 |
--- a/content/common/ssl_status_serialization.cc |
+++ b/content/common/ssl_status_serialization.cc |
@@ -33,6 +33,7 @@ std::string SerializeSecurityInfo(const SSLStatus& ssl_status) { |
pickle.WriteInt(ssl_status.cert_id); |
pickle.WriteUInt32(ssl_status.cert_status); |
pickle.WriteInt(ssl_status.security_bits); |
+ pickle.WriteInt(ssl_status.key_exchange_info); |
pickle.WriteInt(ssl_status.connection_status); |
pickle.WriteInt(ssl_status.signed_certificate_timestamp_ids.size()); |
for (SignedCertificateTimestampIDStatusList::const_iterator iter = |
@@ -59,6 +60,7 @@ bool DeserializeSecurityInfo(const std::string& state, SSLStatus* ssl_status) { |
if (!iter.ReadInt(&security_style) || !iter.ReadInt(&ssl_status->cert_id) || |
!iter.ReadUInt32(&ssl_status->cert_status) || |
!iter.ReadInt(&ssl_status->security_bits) || |
+ !iter.ReadInt(&ssl_status->key_exchange_info) || |
!iter.ReadInt(&ssl_status->connection_status) || |
!iter.ReadInt(&num_scts_to_read)) { |
*ssl_status = SSLStatus(); |
@@ -78,6 +80,12 @@ bool DeserializeSecurityInfo(const std::string& state, SSLStatus* ssl_status) { |
return false; |
} |
+ // Sanity check |key_exchange_info|: 0 or greater. |
+ if (ssl_status->key_exchange_info < 0) { |
+ *ssl_status = SSLStatus(); |
+ return false; |
+ } |
+ |
for (; num_scts_to_read > 0; --num_scts_to_read) { |
int id; |
uint16 status; |