]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
awk: Fix subobject out-of-bounds access
authorarichardson <arichardson@FreeBSD.org>
Mon, 21 Sep 2020 19:03:07 +0000 (19:03 +0000)
committerarichardson <arichardson@FreeBSD.org>
Mon, 21 Sep 2020 19:03:07 +0000 (19:03 +0000)
commitb1200a2233dc71c1f15ba91d06b33aed9bf2e122
treedaa693c81106ab1e9d653ae292136f42892c77d8
parent21ab32fbccab49cee361fc143c7dacf7bc76d008
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
contrib/one-true-awk/awk.h
contrib/one-true-awk/b.c