diff options
author | Shashank Dash <quic_vendetta@quicinc.com> | 2023-04-12 11:17:20 +0530 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2023-04-12 08:45:50 -0700 |
commit | 8e12525929b0d115eb4127a7dc19ea1c7a845be3 (patch) | |
tree | 3a649277cc3bb7caecfb92124858d137ac59b460 | |
parent | f20503c97e19542e15f2e94b0d4fc21fed70dfa1 (diff) |
bt: Fixed possible Buffer Overflows.
CRs-Fixed: 3463971
Change-Id: I1ed1cde35d98a64eda4e327f3e8313f234875f77
-rw-r--r-- | btif/src/btif_av.cc | 4 | ||||
-rw-r--r-- | stack/sdp/sdp_server.cc | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/btif/src/btif_av.cc b/btif/src/btif_av.cc index 2eadc236c..ad549a5a8 100644 --- a/btif/src/btif_av.cc +++ b/btif/src/btif_av.cc @@ -6854,7 +6854,7 @@ int64_t btif_get_average_delay() { ** Returns bool *******************************************************************************/ bool btif_device_in_sink_role() { - char a2dp_role[6] = "false"; + char a2dp_role[255] = "false"; osi_property_get("persist.vendor.service.bt.a2dp.sink", a2dp_role, "false"); if (strncmp("true", a2dp_role, 4) == 0){ BTIF_TRACE_EVENT("%s: SINK role true ",__func__); @@ -6967,7 +6967,7 @@ void btif_av_set_remote_playing_state(int index, bool playing_state) { *******************************************************************************/ int btif_get_max_allowable_sink_connections() { int def_no_of_conn = 1; - char number_of_conn[2]; + char number_of_conn[255]; osi_property_get("persist.vendor.bt.a2dp.sink_conn", number_of_conn, "1"); BTIF_TRACE_DEBUG("%s, number_of_conn = %s", __func__, number_of_conn); if (!strncmp(number_of_conn, "2", 1)) { diff --git a/stack/sdp/sdp_server.cc b/stack/sdp/sdp_server.cc index 6aea47b4d..003a818af 100644 --- a/stack/sdp/sdp_server.cc +++ b/stack/sdp/sdp_server.cc @@ -223,7 +223,7 @@ int sdp_get_stored_avrc_tg_version(RawAddress addr) uint16_t avrcp_features = 0; SDP_TRACE_DEBUG("%s target BD Addr: %s",\ __func__, addr.ToString().c_str()); - char pts_property[6]; + char pts_property[PROPERTY_VALUE_MAX] = {0}; int pts_avrcp_version; osi_property_get(SDP_ENABLE_PTS_AVRCP, pts_property, "false"); if (!strncmp("true", pts_property, 4)) { |