Skip to content

Fix always-true response.c_str() guards in Device_WiFi_SSID RPC response handling - #400

Merged
Vismalskumar0 merged 2 commits into
feature/RDKEMW-14686_finalfrom
copilot/sub-pr-399
Mar 12, 2026
Merged

Fix always-true response.c_str() guards in Device_WiFi_SSID RPC response handling#400
Vismalskumar0 merged 2 commits into
feature/RDKEMW-14686_finalfrom
copilot/sub-pr-399

Conversation

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

std::string::c_str() never returns null, so if (response.c_str()) was always true — silently passing empty RPC responses into cJSON_Parse and producing misleading parse error logs.

Changes

  • GetConnectedSSID / GetWifiState response guards — replaced if (response.c_str()) with if (!response.empty()) to match the already-correct guard used for the GetAvailableInterfaces response
// Before — always evaluates true, even for empty response
if (response.c_str()) { ... }

// After — correctly skips processing on empty response
if (!response.empty()) { ... }

All three RPC response checks in get_Device_WiFi_SSID_Fields (non-RDKV_NM path) now consistently use !response.empty().


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@Vismalskumar0
Vismalskumar0 marked this pull request as ready for review March 12, 2026 09:00
Copilot AI review requested due to automatic review settings March 12, 2026 09:00

Copilot AI 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.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

…SID.cpp

Co-authored-by: Vismalskumar0 <188226757+Vismalskumar0@users.noreply.github.com>
Copilot AI requested a review from a team as a code owner March 12, 2026 09:01
Copilot AI changed the title [WIP] [WIP] Address feedback on Device_WiFi_SSID.cpp updates from PR #399 Fix always-true response.c_str() guards in Device_WiFi_SSID RPC response handling Mar 12, 2026
@Vismalskumar0
Vismalskumar0 merged commit 3beeec2 into feature/RDKEMW-14686_final Mar 12, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 12, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants