From bd308145f125050fd00e24a6464351a47efec2a1 Mon Sep 17 00:00:00 2001 From: havoc Date: Thu, 21 Oct 2004 08:45:59 +0000 Subject: [PATCH] don't allow Log_ConPrint to recurse into itself, as can happen with a memory corruption report -> Log_ConPrint -> memory corruption report -> Log_ConPrint -> ... git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4684 d7cf8633-e32d-0410-b094-e92efae38249 --- console.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/console.c b/console.c index 8020de1b..e9c8797e 100644 --- a/console.c +++ b/console.c @@ -201,6 +201,11 @@ Log_ConPrint */ void Log_ConPrint (const char *msg) { + static qboolean inprogress = false; + // don't allow feedback loops with memory error reports + if (inprogress) + return; + inprogress = true; // Until the host is completely initialized, we maintain a log queue // to store the messages, since the log can't be started before if (logqueue != NULL) @@ -224,6 +229,7 @@ void Log_ConPrint (const char *msg) memcpy (&logqueue[logq_ind], msg, len); logq_ind += len; + inprogress = false; return; } @@ -241,6 +247,7 @@ void Log_ConPrint (const char *msg) if (log_sync.integer) FS_Flush (logfile); } + inprogress = false; } -- 2.39.2