Skip to content

bytesToPacket doesn't handle malformed label packet correctly #222

@shrugs

Description

@shrugs

For example, in this tx 0x4ece50ae828f2a0f27f45d086e85a55e6284bff31a0a89daca9df4b1b1f5cb75 the name input is 8436.eth (it should have been just 8436, as the .eth is inferred).

This operates against a name that actually looks like [fb1d24d5dc41613d5b4874e6cccb06ecf442f6f1773c3771c4fcce1161985a18].eth
which results in a namehash of 0xfb1d24d5dc41613d5b4874e6cccb06ecf442f6f1773c3771c4fcce1161985a18
and the NameWrapper emits an event with the packet bytes of 08383433362E6574680365746800.
when ensjs#bytesToPacket sees these bytes, it returns a name of 8436.eth.eth, which is incorrect.

bytesToPacket(hexToBytes("0x08383433362E6574680365746800")) === '8436.eth.eth'

additional context is available in namehash/ensnode#36 (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