Initialize the blob struct before using it.
Bug: 19457895
Change-Id: Ie69cf9c5c8e6707b9e6d4ded5118775496df4bb9
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp
index eb1b836..4075acf 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -504,6 +504,7 @@
public:
Blob(const uint8_t* value, int32_t valueLength, const uint8_t* info, uint8_t infoLength,
BlobType type) {
+ memset(&mBlob, 0, sizeof(mBlob));
mBlob.length = valueLength;
memcpy(mBlob.value, value, valueLength);
@@ -524,7 +525,9 @@
mBlob = b;
}
- Blob() {}
+ Blob() {
+ memset(&mBlob, 0, sizeof(mBlob));
+ }
const uint8_t* getValue() const {
return mBlob.value;