summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobiasu <tobiasu@openbsd.org>2015-03-27 10:09:30 +0000
committertobiasu <tobiasu@openbsd.org>2015-03-27 10:09:30 +0000
commit5d17599fa46f9cce40010a48b1adf63d5a253a38 (patch)
tree7588eabb52dce023fecd63edfef659f80d1ad4e4
parentx11/gtk+2,-guic -> x11/gtk+3,-guic (diff)
downloadwireguard-openbsd-5d17599fa46f9cce40010a48b1adf63d5a253a38.tar.xz
wireguard-openbsd-5d17599fa46f9cce40010a48b1adf63d5a253a38.zip
Don't display empty error context.
Context extraction didn't handle this case and showed uninitialized memory. ok tobias, miod
-rw-r--r--usr.bin/awk/lib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.bin/awk/lib.c b/usr.bin/awk/lib.c
index a62df2dc86d..753fa8bffea 100644
--- a/usr.bin/awk/lib.c
+++ b/usr.bin/awk/lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib.c,v 1.20 2011/09/28 19:27:18 millert Exp $ */
+/* $OpenBSD: lib.c,v 1.21 2015/03/27 10:09:30 tobiasu Exp $ */
/****************************************************************
Copyright (C) Lucent Technologies 1997
All Rights Reserved
@@ -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')