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

Unified Diff: webrtc/base/rtccertificate.cc

Issue 2424093002: Return nullptr from RTCCertificate::FromPEM on failure. (Closed)
Patch Set: Created 4 years, 2 months 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 | « webrtc/base/rtccertificate.h ('k') | webrtc/base/rtccertificate_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/rtccertificate.cc
diff --git a/webrtc/base/rtccertificate.cc b/webrtc/base/rtccertificate.cc
index 574bf75bf290bb2e84b5aa634a84b13b86786760..3b3b8c9e89fbcaec7b7889a9ab374ac41bf79812 100644
--- a/webrtc/base/rtccertificate.cc
+++ b/webrtc/base/rtccertificate.cc
@@ -54,6 +54,8 @@ scoped_refptr<RTCCertificate> RTCCertificate::FromPEM(
const RTCCertificatePEM& pem) {
std::unique_ptr<SSLIdentity> identity(SSLIdentity::FromPEMStrings(
pem.private_key(), pem.certificate()));
+ if (!identity)
+ return nullptr;
return new RefCountedObject<RTCCertificate>(identity.release());
}
« no previous file with comments | « webrtc/base/rtccertificate.h ('k') | webrtc/base/rtccertificate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698