heim icon indicating copy to clipboard operation
heim copied to clipboard

Fix a possible segfault in heim::net::nic() for Windows

Open daladim opened this issue 4 years ago • 1 comments

Hello,

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

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 avatar Jun 25 '21 08:06 daladim

Coverage Status

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

coveralls avatar Jun 25 '21 09:06 coveralls