Skip to content

fix: check CBOR tagged subtype reads - #5339

Merged
nlohmann merged 2 commits into
nlohmann:developfrom
tomatotomata:codex/cbor-tag-return-5338
Jul 31, 2026
Merged

fix: check CBOR tagged subtype reads#5339
nlohmann merged 2 commits into
nlohmann:developfrom
tomatotomata:codex/cbor-tag-return-5338

Conversation

@tomatotomata

Copy link
Copy Markdown
Contributor

Closes #5338\n\nThe CBOR tagged-binary subtype branches now propagate failed get_number() reads before using the subtype, for both the ignore and store handlers. The regression suite covers truncated 1-, 2-, 4-, and 8-byte subtype tags in both modes. The amalgamated single header was regenerated as required by the project.\n\nVerification:\n- git diff --check passes\n- Static inspection confirms all eight tagged subtype reads now check their return values\n- C++ tests could not be run in this Windows environment because no compiler or CMake is installed

Signed-off-by: ahmadalguydi <ahmadalgaidy@hotmail.com>

@nlohmann nlohmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logics looks good, but the amalgamation is wrong. Please re-amalgamate by running make amalgamate.

@github-actions

This comment was marked as outdated.

Signed-off-by: ahmadalguydi <ahmadalgaidy@hotmail.com>
@tomatotomata
tomatotomata marked this pull request as ready for review July 31, 2026 09:29
@tomatotomata

Copy link
Copy Markdown
Contributor Author

I applied the repository's amalgamation patch from the failed check and pushed 2f31abf. That refreshes single_include/nlohmann/json.hpp and the affected regression-test formatting, with git diff --check clean. The PR is ready for another look; let me know what you think.

@nlohmann nlohmann left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@nlohmann nlohmann added this to the Release 3.13.0 milestone Jul 31, 2026
@nlohmann nlohmann added the 🚀 ready to merge Ready to merge - just waiting for CI to complete. label Jul 31, 2026
@nlohmann
nlohmann merged commit 2222d38 into nlohmann:develop Jul 31, 2026
156 checks passed
@nlohmann

Copy link
Copy Markdown
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

L 🚀 ready to merge Ready to merge - just waiting for CI to complete. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CBOR: get_number() return value discarded when reading tagged-binary subtype (0xD8-0xDB)

2 participants