am 853b8d79: am fd1ad379: am 1c73457a: am b124c9e8: Fix unchecked length in Blob creation

* commit '853b8d7984673976f943fc1664012598cb040696':
  Fix unchecked length in Blob creation
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp
index e56edfd..a956533 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -485,8 +485,16 @@
 
 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) {
+        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);