Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Sep 2017 05:04:06 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r323965 - head/contrib/one-true-awk
Message-ID:  <201709240504.v8O546Ob045630@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Sun Sep 24 05:04:06 2017
New Revision: 323965
URL: https://svnweb.freebsd.org/changeset/base/323965

Log:
  Don't display empty error context.
  
  Context extraction didn't handle this case and showed uninitialized memory.
  
  Obtained from: OpenBSD lib.c 1.21
  Sponsored by: Netflix
  Differential Revision: https://reviews.freebsd.org/D12379

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

Modified: head/contrib/one-true-awk/lib.c
==============================================================================
--- head/contrib/one-true-awk/lib.c	Sun Sep 24 05:04:02 2017	(r323964)
+++ head/contrib/one-true-awk/lib.c	Sun Sep 24 05:04:06 2017	(r323965)
@@ -617,7 +617,7 @@ void eprint(void)	/* try to print context around error
 	static int been_here = 0;
 	extern char ebuf[], *ep;
 
-	if (compile_time == 2 || compile_time == 0 || been_here++ > 0)
+	if (compile_time == 2 || compile_time == 0 || been_here++ > 0 || ebuf == ep)
 		return;
 	p = ep - 1;
 	if (p > ebuf && *p == '\n')



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