Index: remoting/host/host_key_pair.cc |
diff --git a/remoting/host/host_key_pair.cc b/remoting/host/host_key_pair.cc |
index 704f8f88c4745fc5b42a5caf11c0652bfa917e01..ff0f2cfcb380d33a5f1aed33b6738ea778f01aac 100644 |
--- a/remoting/host/host_key_pair.cc |
+++ b/remoting/host/host_key_pair.cc |
@@ -105,6 +105,9 @@ std::string HostKeyPair::GenerateCertificate() const { |
key_.get(), "CN=chromoting", |
base::RandInt(1, std::numeric_limits<int>::max()), |
base::TimeDelta::FromDays(1)); |
+ if (!cert) |
+ return std::string(); |
+ |
std::string encoded; |
bool result = net::X509Certificate::GetDEREncoded(cert->os_cert_handle(), |
&encoded); |