diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-10 00:34:54 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-10 00:34:54 +0000 |
commit | 088b3d85fcbd72b1743b767452abc41fa5c01764 (patch) | |
tree | ba6c4038d2bb7f1dbfd989c78970584fe15fb9bc /net/ocsp | |
parent | 24d07e35d01b64462fc8b68b048097c5d276f479 (diff) | |
download | chromium_src-088b3d85fcbd72b1743b767452abc41fa5c01764.zip chromium_src-088b3d85fcbd72b1743b767452abc41fa5c01764.tar.gz chromium_src-088b3d85fcbd72b1743b767452abc41fa5c01764.tar.bz2 |
Coverity: Fix using pointer to freed string in OCSPTrySendAndReceive.
CID=11514
TEST=builds
BUG=none
Review URL: http://codereview.chromium.org/2941002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52027 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/ocsp')
-rw-r--r-- | net/ocsp/nss_ocsp.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/net/ocsp/nss_ocsp.cc b/net/ocsp/nss_ocsp.cc index c020a71..702baa6 100644 --- a/net/ocsp/nss_ocsp.cc +++ b/net/ocsp/nss_ocsp.cc @@ -651,13 +651,13 @@ SECStatus OCSPTrySendAndReceive(SEC_HTTP_REQUEST_SESSION request, bool crl_in_url = false, crt_in_url = false, ocsp_in_url = false, have_url_hint = false; if (!known_resp_type) { - const char* path = req->url().path().c_str(); - const char* host = req->url().host().c_str(); - crl_in_url = strcasestr(path, ".crl") != NULL; - crt_in_url = strcasestr(path, ".crt") != NULL || - strcasestr(path, ".p7c") != NULL || - strcasestr(path, ".cer") != NULL; - ocsp_in_url = strcasestr(host, "ocsp") != NULL; + const std::string path = req->url().path(); + const std::string host = req->url().host(); + crl_in_url = strcasestr(path.c_str(), ".crl") != NULL; + crt_in_url = strcasestr(path.c_str(), ".crt") != NULL || + strcasestr(path.c_str(), ".p7c") != NULL || + strcasestr(path.c_str(), ".cer") != NULL; + ocsp_in_url = strcasestr(host.c_str(), "ocsp") != NULL; have_url_hint = crl_in_url || crt_in_url || ocsp_in_url; } |