Commit 1abbed6f authored by Misha Efimov's avatar Misha Efimov Committed by Commit Bot

[Cronet] Fix use after free in Cronet PKP test on iOS.

Bug: 670689
Change-Id: I7d09af8130233525bcbf41443266b40709e8b99a
Reviewed-on: https://chromium-review.googlesource.com/568805Reviewed-by: default avatarAndrei Kapishnikov <kapishnikov@chromium.org>
Commit-Queue: Misha Efimov <mef@chromium.org>
Cr-Commit-Position: refs/heads/master@{#490816}
parent 324443a6
......@@ -95,8 +95,8 @@ class PkpTest : public CronetTestBase {
// certificate.
static NSData* NonMatchingHash() {
const int length = 32;
const char* hash = std::string(length, '\077').c_str();
return [NSData dataWithBytes:hash length:length];
std::string hash(length, '\077');
return [NSData dataWithBytes:hash.c_str() length:length];
}
// Returns hash value that matches the hash of the public key certificate used
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment