Skip to content

wifi_ctrl: fix null pointer dereference in bus_get_vap_init_parameter#749

Open
svc-rdkeportal01 wants to merge 1 commit intotopic/coverityfrom
fix/null_check_bus_get_vap_init_parameter
Open

wifi_ctrl: fix null pointer dereference in bus_get_vap_init_parameter#749
svc-rdkeportal01 wants to merge 1 commit intotopic/coverityfrom
fix/null_check_bus_get_vap_init_parameter

Conversation

@svc-rdkeportal01
Copy link

This PR modifies the bus_get_vap_init_parameter function in source/core/wifi_ctrl.c to add null check for the name parameter at the beginning of the function and return early to avoid segfaults.

Changes Made

  • Add null check for name parameter at function start
  • Return early with error logging if null pointer detected
  • Remove redundant null check before bus_data_free_fn() call

Testing

  • Code compiles successfully
  • Logic preservation verified
  • Backward compatible

The bus_get_vap_init_parameter function was using the name parameter
before checking if it was NULL, which could lead to segmentation faults.

This commit adds a null check at the beginning of the function and
returns early if the pointer is NULL, preventing the dereference from
occurring.

Changes:
- Add null check for name parameter at function start
- Return early with error logging if NULL
- Remove redundant null check before bus_data_free_fn()
@svc-rdkeportal01 svc-rdkeportal01 requested a review from a team as a code owner December 5, 2025 19:42
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.

2 participants