HomeFreeBSD

rs: Fix some pointer arith UB.

Description

rs: Fix some pointer arith UB.

If the next column was blank, then the length of the following entry
was computed as the end of the following entry minus a global variable
"blank" which is not in the same string or allocation. Instead, save
the start value of 'p' explicitly instead of abusing '*ep'. Possibly
we should just increment p before saving it in sp in the 'blank' case,
but at worst that would just mean maxlen might be one char too large
which should be harmless.

Reviewed by: brooks
Differential Revision: https://reviews.freebsd.org/D36832

Details

Provenance
jhbAuthored on Oct 5 2022, 11:48 PM
Reviewer
brooks
Differential Revision
D36832: rs: Fix some pointer arith UB.
Parents
rGe5f2d5b35e79: rs: Fix a use after free.
Branches
Unknown
Tags
Unknown