Skip to content

Commit

Permalink
RDKBWIFI-15 Prevent from setting value into index -1 (stack underflow…
Browse files Browse the repository at this point in the history
…) in dm_policy_list.cpp
  • Loading branch information
marcin-matula-2329518 authored and soumyasmunshi committed Dec 20, 2024
1 parent ce12c09 commit 281b970
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dm/dm_policy_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ int dm_policy_list_t::update_db(db_client_t& db_client, dm_orch_type_t op, void
strncat(sta_mac_list_str, ",", strlen(","));
}

sta_mac_list_str[strlen(sta_mac_list_str) - 1] = 0;
if (strlen(sta_mac_list_str) > 0)
{
sta_mac_list_str[strlen(sta_mac_list_str) - 1] = 0;
}

switch (op) {
case dm_orch_type_db_insert:
Expand Down

0 comments on commit 281b970

Please sign in to comment.