diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 23:10:11 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-21 23:10:11 +0000 |
commit | 1ff1763b6d6365cdd287893b5ebcd25ed830fad4 (patch) | |
tree | 84d2a44fe90bb9a75382373ef40aa547a250171f /net/ocsp | |
parent | 3dca839268d048c9272dd1f574001b3821c8477d (diff) | |
download | chromium_src-1ff1763b6d6365cdd287893b5ebcd25ed830fad4.zip chromium_src-1ff1763b6d6365cdd287893b5ebcd25ed830fad4.tar.gz chromium_src-1ff1763b6d6365cdd287893b5ebcd25ed830fad4.tar.bz2 |
If the HTTP response code is -1, don't call OCSPSetResponse because the
request failed and there is no response. This fixes the crashes in
OCSPTrySendAndReceive.
R=willchan
BUG=http://crbug.com/19915
TEST=See issue 19915 for steps to reproduce the crash.
Review URL: http://codereview.chromium.org/174248
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ocsp')
-rw-r--r-- | net/ocsp/nss_ocsp.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc index 78e31fe..64a446d 100644 --- a/net/ocsp/nss_ocsp.cc +++ b/net/ocsp/nss_ocsp.cc @@ -466,6 +466,10 @@ SECStatus OCSPTrySendAndReceive(SEC_HTTP_REQUEST_SESSION request, if (!req->Wait()) return SECFailure; + // If the response code is -1, the request failed and there is no response. + if (req->http_response_code() == static_cast<PRUint16>(-1)) + return SECFailure; + return OCSPSetResponse( req, http_response_code, http_response_content_type, @@ -483,7 +487,8 @@ SECStatus OCSPFree(SEC_HTTP_REQUEST_SESSION request) { return SECSuccess; } -OCSPInitSingleton::OCSPInitSingleton() : io_loop_(MessageLoopForIO::current()) { +OCSPInitSingleton::OCSPInitSingleton() + : io_loop_(MessageLoopForIO::current()) { client_fcn_.version = 1; SEC_HttpClientFcnV1Struct *ft = &client_fcn_.fcnTable.ftable1; ft->createSessionFcn = OCSPCreateSession; |