Commit 76dfb1eb authored by jyasskin's avatar jyasskin Committed by Commit bot

Initialize SCT fields.

This fixes an MSan error introduced by
https://codereview.chromium.org/2294373002/

==31610==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0xa7ce15a in WriteBytesCommon base/pickle.cc:478:3
    #1 0xa7ce15a in WriteBytesStatic<4> base/pickle.cc:443:0
    #2 0x98c5407 in WritePOD<int> base/pickle.h:367:5
    #3 0x98c5407 in WriteInt base/pickle.h:229:0
    #4 0x98c5407 in Persist net/cert/signed_certificate_timestamp.cc:43:0
    #5 0x991c383 in Persist net/http/http_response_info.cc:381:18
    #6 0x2cb75d0 in TestBody net/http/http_response_info_unittest.cc:111:18

  Uninitialized value was stored to memory at
    #0 0x98c57fd in Persist net/cert/signed_certificate_timestamp.cc:43:3
    #1 0x991c383 in Persist net/http/http_response_info.cc:381:18
    #2 0x2cb75d0 in TestBody net/http/http_response_info_unittest.cc:111:18

  Uninitialized value was created by a heap allocation
    #0 0x8da8c2 in operator new(unsigned long) ??:0
    #1 0xa68c2f8 in GetX509CertSCT net/test/ct_test_util.cc:220:14
    #2 0x2cb7451 in TestBody net/http/http_response_info_unittest.cc:104:3

Review-Url: https://codereview.chromium.org/2337983006
Cr-Commit-Position: refs/heads/master@{#418956}
parent 9aba30b7
......@@ -28,7 +28,8 @@ bool SignedCertificateTimestamp::LessThan::operator()(
return lhs->version < rhs->version;
}
SignedCertificateTimestamp::SignedCertificateTimestamp() {}
SignedCertificateTimestamp::SignedCertificateTimestamp()
: version(V1), origin(SCT_EMBEDDED) {}
SignedCertificateTimestamp::~SignedCertificateTimestamp() {}
......@@ -77,7 +78,7 @@ SignedCertificateTimestamp::CreateFromPickle(base::PickleIterator* iter) {
return sct;
}
LogEntry::LogEntry() {}
LogEntry::LogEntry() : type(LOG_ENTRY_TYPE_X509) {}
LogEntry::~LogEntry() {}
......@@ -87,7 +88,8 @@ void LogEntry::Reset() {
tbs_certificate.clear();
}
DigitallySigned::DigitallySigned() {}
DigitallySigned::DigitallySigned()
: hash_algorithm(HASH_ALGO_NONE), signature_algorithm(SIG_ALGO_ANONYMOUS) {}
DigitallySigned::~DigitallySigned() {}
......
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