mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-24 19:21:38 +01:00
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
This commit is contained in:
parent
8e537f8ae0
commit
d12420d872
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323965
@ -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')
|
||||
|
Loading…
Reference in New Issue
Block a user