Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Sep 2020 19:03:12 +0000 (UTC)
From:      Alex Richardson <arichardson@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365969 - head/contrib/one-true-awk
Message-ID:  <202009211903.08LJ3CIa030759@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: arichardson
Date: Mon Sep 21 19:03:12 2020
New Revision: 365969
URL: https://svnweb.freebsd.org/changeset/base/365969

Log:
  Fix another UBSan error in awk
  
  This applies my upstreamed fix: https://github.com/onetrueawk/awk/commit/ad9bd2f40a89ec9533b92254b86a756cf4f40fd4
  Found By:	UBSan

Modified:
  head/contrib/one-true-awk/lex.c

Modified: head/contrib/one-true-awk/lex.c
==============================================================================
--- head/contrib/one-true-awk/lex.c	Mon Sep 21 19:03:07 2020	(r365968)
+++ head/contrib/one-true-awk/lex.c	Mon Sep 21 19:03:12 2020	(r365969)
@@ -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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009211903.08LJ3CIa030759>