RDKEMW-24159 : ctrlm-main - coverity issues 2 - #279
Open
dwolaver wants to merge 10 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses a set of Coverity findings across the ctrlm-main plugin (Control Manager) by tightening ownership/initialization semantics and removing a few patterns that can trigger static-analysis warnings.
Changes:
- Improve object initialization and type safety (e.g., default-initialize members, adjust integer types to match sentinel usage).
- Reduce unnecessary copies by using
std::moveand passingstd::functionbyconst&. - Resolve thread ownership/join analysis concerns and minor logic cleanups flagged by Coverity.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/voice/ctrlm_voice_obj.h | Update pre_session_terminate signature to take std::function by const reference. |
| src/voice/ctrlm_voice_obj.cpp | Add <utility> and use std::move; update pre_session_terminate definition to match header. |
| src/irdb/ctrlm_irdb_interface.h | Default-initialize mode to an offline value to avoid uninitialized use. |
| src/ipc/ctrlm_rcp_ipc_event.h | Adjust member types / default init (e.g., wakeup_key_code_ to signed int; default-init network_id_). |
| src/ctrlm_validation.cpp | Replace ternary return with explicit branch to satisfy analysis/readability. |
| src/ctrlm_network.cpp | Add explicit ref/unref around g_thread_join to clarify ownership to tools and analyzers. |
| src/ctrlm_main.cpp | Reduce repeated json_array_size calls; add null-check for obj_net; adjust #ifdef scope. |
| src/ctrlm_ir_controller.cpp | Add <utility> and move parsed substrings into the vector. |
| src/ctrlm_controller.cpp | Compile-time guard for OTA_MAX_RETRIES; simplify upgrade-progress state logic. |
| src/attributes/ctrlm_attr.h | Explicitly default copy/move constructors and assignments on base attribute type. |
| src/attributes/ctrlm_attr_general.h | Explicitly default copy/move constructors and assignments on attribute derived types. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/ipc/ctrlm_rcp_ipc_event.h:100
wakeup_key_code_now supports -1 as an "invalid" sentinel (see ctor in ctrlm_rcp_ipc_event.cpp), but the default member initializer is0, which can be interpreted as a valid key code. Initializing to-1keeps the default-constructed object consistent with the intended semantics.
int wakeup_key_code_ = 0;
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.