Fix possible use after free with long lines
authortobias <tobias@openbsd.org>
Sat, 8 Jan 2022 11:07:51 +0000 (11:07 +0000)
committertobias <tobias@openbsd.org>
Sat, 8 Jan 2022 11:07:51 +0000 (11:07 +0000)
commitb2f6cc19eec3ce3f40e2c77751b47cec9c0e8fe3
tree43915162ef745ceb64630c148914d4c47d998119
parent76a9da1756fb8ecd778bc130573e94ff6a370e74
Fix possible use after free with long lines

Files with very long lines on machines with tight memory restrictions
can provoke a failing realloc in expand_linebuf. This error condition
was improperly handled, which could lead to a user after free bug by
using the already freed linebuf variable again.

with input by and okay guenther@
usr.bin/less/line.c