Skip to content

Notifier::<Config>::get is unsound #1758

@fuzzypixelz

Description

@fuzzypixelz

Describe the bug

This function has the following signature:

pub fn get<'a>(&'a self, key: &str) -> ZResult<LookupGuard<'a, Config>>

Where LookupGuard<'a, Config> dereferences (using unsafe) into Config. However, the underlying ValidatedMap::get returns Any and is supposed to be the type of a member of Config such as ConnectConfig.

By the way, LookupGuard is not even exported.

Either the signature should be fixed, or get should be removed entirely in favor of get_json.

To reproduce

N/A

System info

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions