Commit Graph

23 Commits

Author SHA1 Message Date
Alex Richardson
ae692c42cb 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 cbf924342b

Found by:	CHERI (with subobject bounds enabled)
Obtained from:	CheriBSD
Reviewed By:	imp
Differential Revision: https://reviews.freebsd.org/D26509
2020-09-21 19:03:07 +00:00
Warner Losh
06d1e65393 Reapply r315426 by pfg:
|    MFV r315425: one-true-awk: have calloc(3) do the multiplication.
2019-06-02 16:30:53 +00:00
Warner Losh
10ce5b990f Reapply r301289 by pfg:
|    MFV r300961: one-true-awk: replace 0 with NULL for pointers
|    Also remove a redundant semicolon.
|    Also had to rebase on upstream pull.
2019-06-02 16:28:20 +00:00
Warner Losh
b525355729 Merge from upstream at 4189ef5d from https://github.com/onetrueawk/awk.git
Note: this backs out a number of changes we've made to awk because
they aren't upstream, but are on the vendor branch. Those will be
reapplied. svn makes it needlessly difficult to know which ones, but
at least r315426, r301289, and maybe r301691, though there may be
others too. None of these are critical, so bisecting through this
point is safe for all but awk regression tests :).
2019-06-02 16:25:07 +00:00
Pedro F. Giffuni
6c10e0ba0b MFV r315425:
one-true-awk: have calloc(3) do the multiplication.

MFC after:	3 days
2017-03-16 21:32:05 +00:00
Andrey A. Chernov
cd3912b6be The bug:
$ echo x | awk '/[[:cntrl:]]/'
x

The NUL character in cntrl class truncates the pattern, and an empty
pattern matches anything. The patch skips NUL as a quick fix.

PR:     195792
Submitted by:   kdrakehp@zoho.com
Approved by:    bwk@cs.princeton.edu (the author)
MFC after:      3 days
2016-09-03 23:04:56 +00:00
Andrey A. Chernov
6c2a17d0b5 Back out non-collating [a-z] ranges.
Instead of changing the whole course to another POSIX-permitted way
for consistency and uniformity I decide to completely ignore missing
regex fucntionality and focus on fixing bugs in what we have now,
too many small obstacles we have choicing other way, counting ports.
Corresponding libc changes are backed out in r302824.
2016-07-14 09:31:52 +00:00
Andrey A. Chernov
1d148a7c3f After removing collation for [a-z] ranges in r302512, do it here too.
I'll try to keep the change very minimal to not touch contribed code much.
I'll send it upstream when it will be merged to main branches,
but we need the change right now here.
2016-07-13 10:01:31 +00:00
Pedro F. Giffuni
9051825205 MFV r300961:
one-true-awk: replace 0 with NULL for pointers

Also remove a redundant semicolon.
2016-06-03 21:23:11 +00:00
Ruslan Ermilov
d86a0988d2 Update to a 7-Aug-2011 release.
Approved by:	re (kib)
2011-08-09 12:54:43 +00:00
Ruslan Ermilov
1b11b78377 Update to a 1-May-2011 release (except for the isblank change). 2011-05-03 11:47:19 +00:00
Ruslan Ermilov
d98dd8e5f9 Apply patches directly to sources. Their effect is as follows:
- Make one-true-awk respect locale's collating order in [a-z]
  bracket expressions, until a more complete fix (like handing
  BREs) is ready.

- Don't require a space between -[fv] and its argument.
2010-01-10 08:02:07 +00:00
Ruslan Ermilov
91217c1c70 Update to a 26-Nov-2009 release. 2010-01-09 23:19:01 +00:00
Ruslan Ermilov
6023075d0d Flatten out vendor tree. 2010-01-09 22:31:11 +00:00
Rong-En Fan
addad6af5a Vendor import of bwk's 01-May-2007 release.
Approved by:	delphij (mentor)
Nodded by:	ru
Tested by:	make universe
2007-06-05 15:33:51 +00:00
Ruslan Ermilov
c263f9bff0 Vendor import of bwk's 24-Apr-2005 release. 2005-05-16 19:11:36 +00:00
Ruslan Ermilov
62ebc626e6 Vendor import of bwk's 7-Feb-2004 release. 2004-02-08 21:32:21 +00:00
Ruslan Ermilov
88b8d48716 Vendor import of bwk's 29-Jul-2003 release. 2003-07-30 06:47:03 +00:00
David E. O'Brien
fc6b1dfe95 Vendor import of bwk's 14-March-2003 release. 2003-03-17 07:59:59 +00:00
David E. O'Brien
72969a2212 Vendor import of bwk's 13-Dec-2002 release. 2002-12-19 04:33:15 +00:00
David E. O'Brien
813da98d0e Vendor import of bwk's 29-Nov-2002 release.
Most significant update is the inclusion of our port's locale patches.
2002-12-13 04:59:48 +00:00
Dag-Erling Smørgrav
007c6572bf Vendor import of bwk's 2002-02-18 release. Most significant update is the
inclusion of my character class patch.
2002-02-19 09:35:25 +00:00
David E. O'Brien
2a55deb138 Import the One True AWK, in the form of bwk's AWK Nov 15, 2000 release. 2001-10-27 08:07:37 +00:00