-
-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
Bug: it fails to satisfy the specification.
BEP 52 — The BitTorrent protocol specification version 2
Integers have no size limitation.
Currently, node-bencode allows decoded integer data to be corrupted. It should either use bigints or throw on a long integer input.
Lines 18 to 28 in 2fa2c7e
| function getIntFromBuffer (buffer, start, end) { | |
| let sum = 0 | |
| let sign = 1 | |
| for (let i = start; i < end; i++) { | |
| const num = buffer[i] | |
| if (num < 58 && num >= 48) { | |
| sum = sum * 10 + (num - 48) | |
| continue | |
| } |
yourdecode("i9007199254740991e") === yourdecode("i9007199254740992e")Metadata
Metadata
Assignees
Labels
No labels