mafintosh / mafintosh/protocol-buffers
encoding an out-of-range integer results in a corrupt message
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 760
- Forks
- 75
- PR merge metrics
- No merged PRs in 30d
Description
Example:
var pb = require('protocol-buffers')
var m = pb("message Test1 { required int32 a = 1; }")
console.log(m.Test1.encode({a: 1e50}))
gives me: <Buffer 08 80 80 80 80 80 80 80 80 80 80> which looks like a corrupt message.
If you try to decode it, it hangs in an infinite loop.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the Node.js reproduction using the Test1.encode and decode calls shown in the issue. Trace the encoding and decoding paths for the int32 field and add coverage for the out-of-range value; done means the input no longer produces a corrupt message and decoding does not hang.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100