Skip to content

Conversation

@svc-rdkeportal01
Copy link

This PR modifies the wifiapi_handle_get_ApAssocDeviceDiagnosticResult function in source/core/wifi_ctrl_wifiapi_handlers.c to add null check for the dev_array variable before dereferencing it.

Changes Made

  • Add null check for dev_array after allocation
  • Return early with error message if null pointer detected
  • Fix closing brace placement

Testing

  • Code compiles successfully
  • Logic preservation verified
  • Backward compatible

…andle_get_ApAssocDeviceDiagnosticResult

The wifiapi_handle_get_ApAssocDeviceDiagnosticResult function was
dereferencing dev_array before checking if it was NULL, which could
lead to segmentation faults.

This commit adds a null check after allocation and returns early
with an error message if the pointer is NULL.

Pattern: null_check_before_dereference_reorder
@svc-rdkeportal01 svc-rdkeportal01 requested a review from a team as a code owner December 5, 2025 20:29
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