Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RDKBWIFI-14 Prevent from setting value into index -1 (stack underflow) in dm_op_class_list.cpp #90

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

marcin-matula-2329518
Copy link
Contributor

No description provided.

@@ -244,8 +244,9 @@ int dm_op_class_list_t::update_db(db_client_t& db_client, dm_orch_type_t op, voi
snprintf(tmp, sizeof(tmp), "%d,", info->channels[i]);
snprintf(channels_str + strlen(channels_str), sizeof(channels_str) - strlen(channels_str), "%s", tmp);
}

channels_str[strlen(channels_str) - 1] = 0;
if (strlen(channels_str) > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To consider if better way is creating variable channels_str_strlen = strlen(channels_str) and using it into if conditon and assignment

@marcin-matula-2329518
Copy link
Contributor Author

@marcin-matula-2329518 marcin-matula-2329518 changed the title RDKBWIFI-14 Prevent from setting value into index -1 (stack underflow) RDKBWIFI-14 Prevent from setting value into index -1 (stack underflow) in dm_op_class_list.cpp Dec 17, 2024
@marcin-matula-2329518 marcin-matula-2329518 marked this pull request as ready for review December 17, 2024 16:31
@soumyasmunshi soumyasmunshi merged commit ce12c09 into rdkcentral:main Dec 20, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants