Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

potential null pointer access / _initializerCallback not initialized #890

Closed
ddmesh opened this issue May 27, 2024 · 0 comments · Fixed by #901
Closed

potential null pointer access / _initializerCallback not initialized #890

ddmesh opened this issue May 27, 2024 · 0 comments · Fixed by #901
Assignees

Comments

@ddmesh
Copy link

ddmesh commented May 27, 2024

When user creates his own object and passes a null pointer for EthernetInterface()
arduino::EthernetClass Ethernet(nullptr); then the uninitialized function pointer _initializerCallback is called accessing some random memory location.

Also as the comment asks "What is this function for?". If this is not defined or documentated, then you should remove it completely to avoid such errors. Beside of this, this "callback" functions makes no sence, as this is called from EthernetClass::begin() synchronously. So the user can call any function afterwards. It is bad design to move private project specific code into public libraries.

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 a pull request may close this issue.

2 participants