aboutsummaryrefslogtreecommitdiff
path: root/contrib/one-true-awk
diff options
context:
space:
mode:
authorAlex Richardson <arichardson@FreeBSD.org>2020-09-21 19:03:12 +0000
committerAlex Richardson <arichardson@FreeBSD.org>2020-09-21 19:03:12 +0000
commit1116946093d537569a29692a6a86de59cd49384e (patch)
tree74ccae8c229c15b39361197e95b7f898876260f5 /contrib/one-true-awk
parentae692c42cb46a5e72772070070840b15dd5d6bd8 (diff)
downloadsrc-1116946093d537569a29692a6a86de59cd49384e.tar.gz
src-1116946093d537569a29692a6a86de59cd49384e.zip
Fix another UBSan error in awk
Notes
Notes: svn path=/head/; revision=365969
Diffstat (limited to 'contrib/one-true-awk')
-rw-r--r--contrib/one-true-awk/lex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/contrib/one-true-awk/lex.c b/contrib/one-true-awk/lex.c
index 8e689f1a682a..e537df4151da 100644
--- a/contrib/one-true-awk/lex.c
+++ b/contrib/one-true-awk/lex.c
@@ -467,9 +467,8 @@ int word(char *w)
int c, n;
n = binsearch(w, keywords, sizeof(keywords)/sizeof(keywords[0]));
-/* BUG: this ought to be inside the if; in theory could fault (daniel barrett) */
- kp = keywords + n;
if (n != -1) { /* found in table */
+ kp = keywords + n;
yylval.i = kp->sub;
switch (kp->type) { /* special handling */
case BLTIN: