NetBSD/external/historical
kamil 463be44101 Do not use index out of bounds in nawk
$ awk '{w=$1}' < /dev/null
/public/src.git/external/historical/nawk/bin/../dist/lex.c:476:16: runtime error: index -1 out of bounds for type 'const Keyword [46]'

There used to be documented a bug in the code that index ouf of bounds
can in theory fault (by daniel barrett).

Before assigning the pointer, first check for the index whether it's not
not -1. This was a suggested solution in the comment in the code.

The sanitizer is overcautious as this pointer wasn't dereferenced, but
fix is nonetheless.

Sponsored by <The NetBSD Foundation>
2018-06-12 13:24:28 +00:00
..
nawk Do not use index out of bounds in nawk 2018-06-12 13:24:28 +00:00
Makefile awk glue 2010-08-26 14:57:15 +00:00