diff options
author | Chad Brubaker <cbrubaker@google.com> | 2015-08-12 23:03:06 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-08-12 23:03:06 +0000 |
commit | 1b8885baf5ebe2e2e6fdfe6e53174fd79f46ae11 (patch) | |
tree | 41db9f54fde0d21b1e0cb2d6a2c64dfed85625d7 | |
parent | 1c73457afe3cb0afbc2a2884c41cfdd1148aca36 (diff) | |
parent | 0d5935262dbbcaf2cf6145529ffd71a728ef4609 (diff) | |
download | android_system_security-1b8885baf5ebe2e2e6fdfe6e53174fd79f46ae11.tar.gz android_system_security-1b8885baf5ebe2e2e6fdfe6e53174fd79f46ae11.tar.bz2 android_system_security-1b8885baf5ebe2e2e6fdfe6e53174fd79f46ae11.zip |
am 0d593526: Properly check for Blob max length
* commit '0d5935262dbbcaf2cf6145529ffd71a728ef4609':
Properly check for Blob max length
-rw-r--r-- | keystore/keystore.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/keystore/keystore.cpp b/keystore/keystore.cpp index 605df3b..f120a36 100644 --- a/keystore/keystore.cpp +++ b/keystore/keystore.cpp @@ -412,12 +412,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; |