Skip to content

Stack overflow during decoding #88

Description

@michael-weigelt

In decode.rs, impl Read for Decoder is defined recursively. While all recursive calls are in the tail position, Rust does not guarantee eliminating tail calls, so this can overflow the stack given a malicious input.

Attachments:

  • test.patch contains a test that fails on master.
  • loop.patch refactors Read for Decoder to use a loop. With this patch, test.patch succeeds.

test.patch

loop.patch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions