ss10:~$ awk -f foo
awk: can't open file foo
 source line number 1 source file foo
  context is
           >>> ΓΏ <<<

Oh look, the international sign for buffer overflow.

Don't print context when ebuf is empty

--- lib.c.orig  Wed Mar 25 17:11:49 2015
+++ lib.c       Wed Mar 25 17:11:27 2015
@@ -648,7 +648,8 @@ 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')

Reply via email to