am 803f37f5: Fix unchecked length in Blob creation

* commit '803f37f5d1bf75cb6e0d007f7d473645efd19a1d':
  Fix unchecked length in Blob creation
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp
index bf1dec6..8a43f02 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -505,9 +505,17 @@
 
 class Blob {
 public:
-    Blob(const uint8_t* value, int32_t valueLength, const uint8_t* info, uint8_t infoLength,
+    Blob(const uint8_t* value, size_t valueLength, const uint8_t* info, uint8_t infoLength,
             BlobType type) {
         memset(&mBlob, 0, sizeof(mBlob));
+        if (valueLength > sizeof(mBlob.value)) {
+            valueLength = sizeof(mBlob.value);
+            ALOGW("Provided blob length too large");
+        }
+        if (infoLength + valueLength > sizeof(mBlob.value)) {
+            infoLength = sizeof(mBlob.value) - valueLength;
+            ALOGW("Provided info length too large");
+        }
         mBlob.length = valueLength;
         memcpy(mBlob.value, value, valueLength);