HomeFreeBSD

awk: Fix subobject out-of-bounds access

Description

awk: Fix subobject out-of-bounds access

When matching a regex with ^, it would attempt to access
gototab[NSTATES][NCHARS+2], and therefore access the state for the \002
character instead. This change is required to run awk under CHERI (with
sub-object bounds) and when running with UBSan instrumentation.

This was committed upstream as https://github.com/onetrueawk/awk/commit/cbf924342b63a095a4c6842280c3085b1b63ae45

Found by: CHERI (with subobject bounds enabled)
Obtained from: CheriBSD
Reviewed By: imp
Differential Revision: https://reviews.freebsd.org/D26509

Details

Provenance
arichardsonAuthored on
Reviewer
imp
Differential Revision
D26509: awk: Fix subobject out-of-bounds access
Parents
rS365967: Whitespace fix after r365948
Branches
Unknown
Tags
Unknown