summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Brubaker <cbrubaker@google.com>2015-08-12 23:29:45 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-12 23:29:45 +0000
commitaca711395dd65d05b48c8bec3b1d2da8d81d41b8 (patch)
treecb07329d4656242cdacef40862128275d9dfb7b4
parent853b8d7984673976f943fc1664012598cb040696 (diff)
parent738d1e9d0ec29964f01211ceb6f471d6666b2316 (diff)
downloadandroid_system_security-aca711395dd65d05b48c8bec3b1d2da8d81d41b8.tar.gz
android_system_security-aca711395dd65d05b48c8bec3b1d2da8d81d41b8.tar.bz2
android_system_security-aca711395dd65d05b48c8bec3b1d2da8d81d41b8.zip
am 738d1e9d: am 1b8885ba: am 0d593526: Properly check for Blob max length
* commit '738d1e9d0ec29964f01211ceb6f471d6666b2316': Properly check for Blob max length
-rw-r--r--keystore/keystore.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp
index 58d2fd6..4fdd593 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -487,12 +487,12 @@ class Blob {
public:
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);
+ if (valueLength > VALUE_SIZE) {
+ valueLength = VALUE_SIZE;
ALOGW("Provided blob length too large");
}
- if (infoLength + valueLength > sizeof(mBlob.value)) {
- infoLength = sizeof(mBlob.value) - valueLength;
+ if (infoLength + valueLength > VALUE_SIZE) {
+ infoLength = VALUE_SIZE - valueLength;
ALOGW("Provided info length too large");
}
mBlob.length = valueLength;