Skip to content

StreamDeserializer enters a busy-loop for malformed input #647

@matklad

Description

@matklad

See the test in

oli-obk/cargo_metadata@ea84dc3

There, the for message in stream_deserilizer loop loops infinitelly, because serde repeteadly tries to parse the same invalid portion of input.

I think the correct behavior here is to "poison" the Iterator after the first error and return None. I can also imagine some error-recovey strategy (like skipping to the next utf8 codepoint), but poisoning seems more reliable to me.

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