リビジョン | 8e702ed3539caac44a616243e33aaad1b2b4801f (tree) |
---|---|
日時 | 2018-05-26 03:42:03 |
作者 | Ajay Panicker <apanicke@goog...> |
コミッター | android-build-team Robot |
DO NOT MERGE: Check number of attributes before writing to a buffer
Bug: 73824150
Test: Compile
Change-Id: I2a28a503cd74758e707d1e591b55c278d2299f45
(cherry picked from commit f6db54f071f6974e18b10bb0c2cfcf397cd4c980)
@@ -45,6 +45,7 @@ | ||
45 | 45 | #include "btif_util.h" |
46 | 46 | #include "btu.h" |
47 | 47 | #include "device/include/interop.h" |
48 | +#include "log/log.h" | |
48 | 49 | #include "osi/include/list.h" |
49 | 50 | #include "osi/include/osi.h" |
50 | 51 | #include "osi/include/properties.h" |
@@ -3502,6 +3503,12 @@ static void handle_app_cur_val_response(tBTA_AV_META_MSG* pmeta_msg, | ||
3502 | 3503 | RawAddress rc_addr = p_dev->rc_addr; |
3503 | 3504 | |
3504 | 3505 | app_settings.num_attr = p_rsp->num_val; |
3506 | + | |
3507 | + if (app_settings.num_attr > BTRC_MAX_APP_SETTINGS) { | |
3508 | + android_errorWriteLog(0x534e4554, "73824150"); | |
3509 | + app_settings.num_attr = BTRC_MAX_APP_SETTINGS; | |
3510 | + } | |
3511 | + | |
3505 | 3512 | for (xx = 0; xx < app_settings.num_attr; xx++) { |
3506 | 3513 | app_settings.attr_ids[xx] = p_rsp->p_vals[xx].attr_id; |
3507 | 3514 | app_settings.attr_values[xx] = p_rsp->p_vals[xx].attr_val; |