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')
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to