Page MenuHomeFreeBSD

awk: Fix subobject out-of-bounds access

Authored by arichardson on Sep 21 2020, 2:57 PM.



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

Found by: CHERI (with subobject bounds enabled)
Obtained from: CheriBSD

Diff Detail

rS FreeBSD src repository
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

arichardson created this revision.
This revision is now accepted and ready to land.Sep 21 2020, 6:32 PM
This revision was automatically updated to reflect the committed changes.