Skip to content

Sdbusplus allows serializing variant with a contained variant #88

@edtanous

Description

@edtanous

https://gerrit.openbmc.org/c/openbmc/bmcweb/+/67652

Exposed a minor problem in sdbusplus in that it allows serializing a double-wrapped variant container of dbus type.

v{v{d}}

Wrapping a variant within a variant on dbus is nonsensisical. This should ideally be a compile-time error when trying to instantiate a type_id of std::variant<std::variant<types...>>.

Opening this bug just for documentation at the moment.

Here is where the read call is getting instantiated.

constexpr auto dbusType = utility::tuple_to_array(types::type_id<T1>());

And this is the type_id definition for std::variant. I suspect we can put a static_assert here.
https://github.com/openbmc/sdbusplus/blob/ae01928016f2983aa44f1279a2575572514953f7/include/sdbusplus/message/types.hpp#L260C75-L260C75

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions