]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 63260] Don't recurse forever if setup_tmpfile() fails
authorPaul Smith <psmith@gnu.org>
Mon, 24 Oct 2022 04:48:47 +0000 (00:48 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 24 Oct 2022 05:50:12 +0000 (01:50 -0400)
commitd18a87d0a40f326d219c7dbabc50e824956f4497
tree164e3ea4712d603c569ba63278e80cce262076df
parent41c35f2ffe58a5b90b63256a199d674696f8a743
[SV 63260] Don't recurse forever if setup_tmpfile() fails

If we fail during setup_tmpfile() we'll try to write an error, which
will invoke setup_tmpfile() again, etc.  Avoid infinite recursion.
Original patch by Dmitry Goncharov <dgoncharov@users.sf.net>

* src/output.c (setup_tmpfile): Remember we're in this function and
return immediately if we enter it during recursion.
(message): Remember the starting location and use that instead of
fmtbuf.buffer.
(error): Ditto.
(fatal): Ditto.
src/output.c