fix: use unsigned char cast and sizeof in LogEscape escape sequence #255

pull mangoostaa wants to merge 1 commits into bitcoin-core:master from mangoostaa:fix/logescape-snprintf changing 1 files +1 −1
  1. mangoostaa commented at 5:37 AM on March 12, 2026: contributor

    Found a small correctness issue in LogEscape():

    • When char is signed (common on x86_64 Linux), negative byte values (e.g. 0xFF = -1) were being printed as ffffffff instead of ff.

    • This fixes it by casting to unsigned char before %02x.

    • Also changed the hardcoded 4 to sizeof(escape) so the code doesn't break silently if someone increases the buffer size later.

    No performance impact, just safer and more portable.

  2. fix: use unsigned char cast and sizeof in LogEscape escape sequence 554a481ea7
  3. DrahtBot commented at 5:37 AM on March 12, 2026: none

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK ryanofsky

    If your review is incorrectly listed, please copy-paste <code>&lt;!--meta-tag:bot-skip--&gt;</code> into the comment that the bot should ignore.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. ryanofsky approved
  5. ryanofsky commented at 5:43 PM on March 23, 2026: collaborator

    Code review ACK 554a481ea73322c7c233dbc7b077a3cd087a9ef7. Signed fix and sizeof cleanup both makes sense. Nice catch!

  6. ryanofsky merged this on Mar 23, 2026
  7. ryanofsky closed this on Mar 23, 2026

  8. ryanofsky referenced this in commit c7cdd9dad6 on Mar 26, 2026
  9. ryanofsky referenced this in commit d45e185fe3 on Mar 27, 2026
  10. ryanofsky referenced this in commit db2dc76ee3 on Mar 27, 2026
  11. ryanofsky referenced this in commit 2478a15ef9 on Mar 30, 2026
  12. fanquake referenced this in commit b0f68f0a3a on Mar 30, 2026
  13. fanquake referenced this in commit 7375940eb2 on Apr 1, 2026
  14. Sjors referenced this in commit 65abfa3c1a on Apr 15, 2026
  15. morozow referenced this in commit 08e84496a9 on May 8, 2026
  16. Sjors referenced this in commit 0dd3f5c989 on May 12, 2026

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/libmultiprocess. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-31 17:30 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me