QCBOR FinishGetSize does not set needed encoding size on small buffers
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 14
- Forks
- 9
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 33
Description
QCBOREncode_FinishGetSize does not set the second argument if the output buffer is too small:
Internally, QCBOREncode_FinishGetSize checks for QCBOR_SUCCESS to set the encoding length, but on small buffers QCBOR_ERR_BUFFER_TOO_SMALL is instead returned, and the encoding length is not set.
Workaround for BSL ASB encoding: set the buffer to be as large as needed for test fixtures
Contributor guide
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
Locate QCBOREncode_FinishGetSize and trace how it handles QCBOR_ERR_BUFFER_TOO_SMALL. Confirm the existing behavior when the output buffer is too small, then verify that the second argument reports the needed encoding size in that case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100