]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
don't allow Log_ConPrint to recurse into itself, as can happen with a memory corrupti...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 21 Oct 2004 08:45:59 +0000 (08:45 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 21 Oct 2004 08:45:59 +0000 (08:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4684 d7cf8633-e32d-0410-b094-e92efae38249

console.c

index 8020de1baaab8863f89136e2c2239f18ab5a2a0f..e9c8797ec4065f5b7eba6bc8133d4fae083a363d 100644 (file)
--- 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;
 }