Skip to content

Conversation

jserv
Copy link
Contributor

@jserv jserv commented Sep 22, 2025

This replaces strncat-based appends in gen_hist_bar with bounded memcpy while tracking remaining capacity and always NUL-terminating.


Summary by cubic

Hardened histogram bar rendering by replacing strncat with bounded memcpy, tracking remaining capacity, and always NUL-terminating. Prevents buffer overruns when writing UTF-8 block glyphs and safely handles zero-length buffers.

  • Bug Fixes
    • Append full and partial block glyphs only when there’s room for the glyph plus NUL; stop otherwise.
    • Early return if buffer length is 0; ensure final NUL termination in all paths.

cubic-dev-ai[bot]

This comment was marked as outdated.

This replaces strncat-based appends in gen_hist_bar with bounded memcpy
while tracking remaining capacity and always NUL-terminating.
@jserv jserv merged commit cb76e39 into master Sep 22, 2025
30 of 33 checks passed
@jserv jserv deleted the fix-rv-histogram branch September 22, 2025 12:55
@jserv jserv added this to the release-2025.2 milestone Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant