summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stack/bnep/bnep_api.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/stack/bnep/bnep_api.c b/stack/bnep/bnep_api.c
index 76bffca50..7c7426383 100644
--- a/stack/bnep/bnep_api.c
+++ b/stack/bnep/bnep_api.c
@@ -23,6 +23,7 @@
******************************************************************************/
#include <string.h>
+#include <log/log.h>
#include "bnep_api.h"
#include "bnep_int.h"
@@ -413,6 +414,10 @@ tBNEP_RESULT BNEP_WriteBuf (UINT16 handle,
else
{
new_len += 4;
+ if (new_len > org_len) {
+ android_errorWriteLog(0x534e4554, "74947856");
+ return BNEP_IGNORE_CMD;
+ }
p_data[2] = 0;
p_data[3] = 0;
}
@@ -521,6 +526,10 @@ tBNEP_RESULT BNEP_Write (UINT16 handle,
else
{
new_len += 4;
+ if (new_len > org_len) {
+ android_errorWriteLog(0x534e4554, "74947856");
+ return BNEP_IGNORE_CMD;
+ }
p_data[2] = 0;
p_data[3] = 0;
}