Skip to content

Fix indentation overflow and correctness bug#5186

Open
nlohmann wants to merge 2 commits into
developfrom
fix-indent_string-resize
Open

Fix indentation overflow and correctness bug#5186
nlohmann wants to merge 2 commits into
developfrom
fix-indent_string-resize

Conversation

@nlohmann
Copy link
Copy Markdown
Owner

There are two issues in the current dump function:

  • Overflow (reported by @manop55555): Under large indent_step values, indent_string growth is insufficient and can lead to buffer over-read / memory safety problems depending on write_characters() behavior. A GitHub Security Advisory will be published referencing this PR.
  • In the resize of indent_string, a space character instead of the passed indent_char was used.

nlohmann added 2 commits May 20, 2026 21:56
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
Signed-off-by: Niels Lohmann <mail@nlohmann.me>
@nlohmann nlohmann added the review needed It would be great if someone could review the proposed changes. label May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

M review needed It would be great if someone could review the proposed changes. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant