Commit 8a2c33b6 authored by Chad Brubaker's avatar Chad Brubaker Committed by Android Git Automerger
Browse files

am 48d998cd: am aca71139: am 738d1e9d: am 1b8885ba: am 0d593526: Properly check for Blob max length

* commit '48d998cd':
  Properly check for Blob max length
parents c761a1ed 48d998cd
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment