Skip to content

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

Open
Vismalskumar0 with Copilot wants to merge 1 commit into
feature/RDKEMW-14686_finalfrom
copilot/sub-pr-399-another-one
Open

Fix always-true response.c_str() guards in Device_WiFi_SSID RPC response handling#402
Vismalskumar0 with Copilot wants to merge 1 commit into
feature/RDKEMW-14686_finalfrom
copilot/sub-pr-399-another-one

Conversation

Copilot AI commented Mar 12, 2026

Copy link
Copy Markdown
Contributor

std::string::c_str() never returns null, so all three if (response.c_str()) guards in get_Device_WiFi_SSID_Fields were always evaluating to true — silently proceeding to parse empty responses and producing misleading error logs.

Changes

  • Device_WiFi_SSID.cpp: Replace if (response.c_str()) with if (!response.empty()) for all three RPC response checks:
    • GetConnectedSSID
    • GetAvailableInterfaces
    • GetWifiState
// Before — always true, never catches empty response
if (response.c_str())

// After — correctly detects empty RPC response
if (!response.empty())

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

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

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.

Copilot AI changed the title [WIP] [WIP] Address feedback on Device_WiFi_SSID.cpp update Fix always-true response.c_str() guards in Device_WiFi_SSID RPC response handling Mar 12, 2026
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