rust-cli / rexpect

.github/workflows/ci.yml
https://docs.rs/rexpect
MIT License
328 stars 56 forks source link

Clean up warnings, fix one soundness issue #12

Closed TyPR124 closed 4 years ago

TyPR124 commented 4 years ago

I am still working on adding Windows support, but was hoping to get this merged first.

This PR does two things, First, it cleans up all warnings in the build. Second, and more importantly, it fixes a potential soundness issue where a non-mutable buffer was passed to a C function ioctl that mutated it. The fix is simply to make the buffer mutable, and pass a mutable reference to ioctl.

These changes do not have any impact on functionality other than fixing the soundness issue. That said, the soundness issue was in an OSX-specific function, so it may be worth running cargo test on OSX to be sure.

philippkeller commented 4 years ago

thanks, has less warnings now. I cannot judge the ioctl part, but I believe you judge this issue better than me

philippkeller commented 4 years ago

forgot to mention: ran the tests on OSX and the examples (some are broken, but the example itself needs to be fixed, I'll do that another time in master)