Skip to content
Snippets Groups Projects
Commit 627f84f7 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

GattServcer: Check invalid offset am: afb0e3bb am: a594bbcb

Change-Id: I1d497b86f89219c8a8885f17bf969a670c6433b6
parents 1ef9ad9d a594bbcb
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,7 @@
#include <base/logging.h>
#include "osi/include/log.h"
#include "service/logging_helpers.h"
#include "stack/include/bt_types.h"
......@@ -116,6 +117,12 @@ bool GattServer::SendResponse(const std::string& device_address, int request_id,
return false;
}
if (offset < 0) {
android_errorWriteLog(0x534e4554, "143231677");
LOG(ERROR) << "Offset is less than 0 offset: " << offset;
return false;
}
if (value.size() + offset > BTGATT_MAX_ATTR_LEN) {
LOG(ERROR) << "Value is too large";
return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment