HomeFreeBSD

backtrace: fix off-by-one on string output

Description

backtrace: fix off-by-one on string output

sizeof("foo") includes the trailing null byte, so all the output had
nulls through it. Most terminals quietly ignore it, but it makes some
tools misdetect file types and other annoyances.

Easy fix: subtract 1.

Sponsored-by: https://despairlabs.com/sponsor/
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Signed-off-by: Rob Norris <robn@despairlabs.com>
Closes #16862

Details

Provenance
rob.norris_klarasystems.comAuthored on Dec 13 2024, 6:12 PM
GitHub <noreply@github.com>Committed on Dec 13 2024, 6:12 PM
Parents
rG6c9b4f18d3e6: Fix DR_OVERRIDDEN use-after-free race in dbuf_sync_leaf
Branches
Unknown
Tags
Unknown