Skip to content

Conversation

@svc-rdkeportal01
Copy link

@svc-rdkeportal01 svc-rdkeportal01 commented Dec 5, 2025

This PR modifies the process_eap_data function in source/core/wifi_8021x.c to move null checks for data and data->data to the beginning of the function and return early to avoid segfaults.

Changes Made

  • Add null check for data and data->data at function start
  • Return early with error logging if null pointers detected
  • Remove redundant null checks before free() calls

Testing

  • Code compiles successfully
  • Logic preservation verified
  • Backward compatible

The process_eap_data function was dereferencing data->data before
checking if the pointers were NULL, which could lead to segmentation
faults.

This commit moves the null checks to the beginning of the function
and returns early if null pointers are detected, preventing the
dereference from occurring.

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