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

missing null pointer checks #889

Closed
ddmesh opened this issue May 27, 2024 · 1 comment · Fixed by #901
Closed

missing null pointer checks #889

ddmesh opened this issue May 27, 2024 · 1 comment · Fixed by #901
Assignees

Comments

@ddmesh
Copy link

ddmesh commented May 27, 2024

Per default an object is created via arduino::EthernetClass Ethernet;. In this case the eth_if member got initialized (which is a pointer).

But when user creates his own object and passes a null pointer for EthernetInterface()
arduino::EthernetClass Ethernet(nullptr);
Several calls to other public functions, will directly call/access the null pointer.

eth_if->get_emac().set_hwaddr(mac);


return (eth_if->get_connection_status() == NSAPI_STATUS_GLOBAL_UP ? LinkON : LinkOFF);

@manchoz
Copy link
Contributor

manchoz commented Jun 11, 2024

Hey, @ddmesh, would you mind adding the null-pointer checks where needed and submitting a PR?

Thanks!

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.

3 participants