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

Fix Clippy warnings on FreeBSD with the latest nightly #1639

Merged
merged 2 commits into from
Jan 23, 2022

Commits on Jan 22, 2022

  1. Better type safety for mqueue

    On some platforms, mqd_t is a pointer.  That means code like the below
    can trigger a segfault.  Fix it by defining a Newtype around mqd_t that
    prevents use-after-free and dangling pointer scenarios.
    
    ```rust
    fn invalid_mqd_t() {
        let mqd: libc::mqd_t = std::ptr::null_mut();
        mq_close(mqd).unwrap();
    }
    ```
    
    Also, get test coverage for mqueue in CI on FreeBSD.
    asomers committed Jan 22, 2022
    Configuration menu
    Copy the full SHA
    475da53 View commit details
    Browse the repository at this point in the history
  2. Suppress clippy::not_unsafe_ptr_arg_deref warnings in ptrace on BSD

    Technically these functions don't violate Rust's safety rules, because
    libc::ptrace doesn't dereference those pointer args.  Instead, it passes
    them directly to the kernel.
    asomers committed Jan 22, 2022
    Configuration menu
    Copy the full SHA
    91049bc View commit details
    Browse the repository at this point in the history