Skip to content

RDKEMW-24159 : ctrlm-main - coverity issues 2 - #279

Open
dwolaver wants to merge 10 commits into
developfrom
feature/RDKEMW-24159_ctrlm_main_coverity_2
Open

RDKEMW-24159 : ctrlm-main - coverity issues 2#279
dwolaver wants to merge 10 commits into
developfrom
feature/RDKEMW-24159_ctrlm_main_coverity_2

Conversation

@dwolaver

Copy link
Copy Markdown
Contributor

No description provided.

@dwolaver
dwolaver marked this pull request as ready for review August 31, 2026 20:47
Copilot AI lite review requested due to automatic review settings August 31, 2026 20:47
@dwolaver
dwolaver requested a review from a team as a code owner August 31, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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::move and passing std::function by const&.
  • 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.

Comment thread src/ctrlm_main.cpp Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 31, 2026 20:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 is 0, which can be interpreted as a valid key code. Initializing to -1 keeps the default-constructed object consistent with the intended semantics.
    int                       wakeup_key_code_    = 0;

@egalla204 egalla204 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

approved for test

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.

3 participants