Skip to content

Interpreter doesn't validate "unused" bits terminal byte in varint #746

Closed

Description

@binji

See WebAssembly/wabt#799.

I belive the encoded value 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0xff 0x7e is not valid as a 64-bit signed varint, as the value it is decoded to, 9151314442816847872, should be encoded as 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0x80 0xff 0x00, where the top bits of the last byte are a sign-extension of the sign bit (the least-significant bit).

Activity

  1. binji commented on Mar 13, 2018

    @binji
    MemberAuthor

    cc @rossberg, am I misunderstanding the spec here? v8's implementation at least matches this behavior.

  2. rossberg commented on Mar 13, 2018

    @rossberg
    Member

    No, this is indeed a bug in the interpreter, the shift for the mask it used was off by one. Fixed in #750, with a range of new binary tests for LEB encodings. PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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