Skip to content

MAX_INT64 issue #35

@pldubouilh

Description

@pldubouilh

According to the bep_0044, it should be possible to set an integer to MAX_INT64, (i.e. 0x7fffffffffffffff). libtorrent successfully bencode this number, although node-bencode doesn't allow this and I receive this error :

WARNING: Possible data corruption detected with value 9223372036854776000: Bencoding only defines support for integers, value was converted to 0

Which is fairly normal as my number is too big.

At the moment I hacked the number encoding case to push a hand crafted buffer when I detect an overflow, but it's not pretty at all... I don't see any easy solution, apart from using a library dedicated to handling large numbers, like node-int64.

Any thoughts ?
Cheers !

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions