From 9310d452c9cd1dbff4d87557001634ed8d624ed4 Mon Sep 17 00:00:00 2001 From: "M. Warner Losh" Date: Sun, 2 Jun 2019 15:23:06 -0600 Subject: [PATCH] Apply the following from FreeBSD / OpenBSD: 323965 | imp | 2017-09-23 23:04:06 -0600 (Sat, 23 Sep 2017) | 8 lines 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 --- lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib.c b/lib.c index 7e83439..864326e 100644 --- a/lib.c +++ b/lib.c @@ -647,7 +647,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; if (ebuf == ep) return;