NASA-AMMOS / NASA-AMMOS/BSL

QCBOR FinishGetSize does not set needed encoding size on small buffers

Open
#35 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.