summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Brubaker <cbrubaker@google.com>2015-08-12 23:45:35 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-12 23:45:35 +0000
commit8a2c33b6f9b28e18a2a59d1fa0e11cf553a51eac (patch)
treecd127f195effd85b3069d1597bf7a5f7c790e96b
parentc761a1ed08d110348bdc897804f3ba59d746579f (diff)
parent48d998cd4982554f9b66b029331dab17154299cc (diff)
downloadandroid_system_security-8a2c33b6f9b28e18a2a59d1fa0e11cf553a51eac.tar.gz
android_system_security-8a2c33b6f9b28e18a2a59d1fa0e11cf553a51eac.tar.bz2
android_system_security-8a2c33b6f9b28e18a2a59d1fa0e11cf553a51eac.zip
am 48d998cd: am aca71139: am 738d1e9d: am 1b8885ba: am 0d593526: Properly check for Blob max length
* commit '48d998cd4982554f9b66b029331dab17154299cc': 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 bdc7645..2144de2 100644
--- a/keystore/keystore.cpp
+++ b/keystore/keystore.cpp
@@ -495,12 +495,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;