Skip to content

Conversation

@daladim
Copy link
Contributor

@daladim daladim commented Jun 25, 2021

Hello,

After some time using heim::net::nic() on Windows (which I implemented some time ago in ad69138), I realized I introduced a potential null pointer dereferencing 😨

I've actually ran into this in some tests of mine, that segfaulted when an adapter had not been assigned any IP address.

This MR fixes this issue by properly checking for null pointers where I had forgotten to do so.
Luckily, this bug has never reached a tagged version nor a published version of the heim crate in crates.io

@daladim daladim force-pushed the nic_segfault branch 2 times, most recently from b51ce33 to d5f2258 Compare June 25, 2021 08:59
daladim added 3 commits June 25, 2021 11:25
A null pointer here means "no interface", not an error.
An error is signalled by res != NO_ERROR
@daladim daladim force-pushed the nic_segfault branch 4 times, most recently from 9fcdfc5 to 9145064 Compare June 25, 2021 09:37
@coveralls
Copy link

coveralls commented Jun 25, 2021

Coverage Status

Coverage increased (+0.3%) to 46.429% when pulling 4adea5c on daladim:nic_segfault into b292f15 on heim-rs:master.

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