]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
awk: Fix subobject out-of-bounds access
authorAlex Richardson <arichardson@FreeBSD.org>
Mon, 21 Sep 2020 19:03:07 +0000 (19:03 +0000)
committerAlex Richardson <arichardson@FreeBSD.org>
Mon, 21 Sep 2020 19:03:07 +0000 (19:03 +0000)
commitae692c42cb46a5e72772070070840b15dd5d6bd8
treedaa693c81106ab1e9d653ae292136f42892c77d8
parent52664466c7be2c98112ceb127d2a6e3f420010a7
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