Skip to content

SegFault when unserializing nonexistent enum case #186

Description

@cracksalad

Say, we have this enum:

enum TestEnum {
  case A;
  case B;
}

and we serialize TestEnum::B. Then, in another environment we unserialize while having another enum definition:

enum TestEnum {
  case A;
}

In this scenario, msgpack_unserialize will spit out a segmentation fault. The same will happen, if the enum definition would look like this:

enum TestEnum {
  case A;

  public const B = 42;
}

In conclusion: When unserializing an enum value, a check if the specified case even exists seems to be missing, leading to SegFault.

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