From: molivier Date: Mon, 26 Aug 2002 06:24:30 +0000 (+0000) Subject: Fixed a potential buffer overflow in Con_DebugLog X-Git-Tag: RELEASE_0_2_0_RC1~308 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=5f5bba7078add4a2e482c09b5f93044d482093f4;p=xonotic%2Fdarkplaces.git Fixed a potential buffer overflow in Con_DebugLog git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2288 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/console.c b/console.c index 14dcb7dc..3311dbc9 100644 --- a/console.c +++ b/console.c @@ -358,15 +358,13 @@ Con_DebugLog void Con_DebugLog(char *file, char *fmt, ...) { va_list argptr; - static char data[1024]; - int fd; + FILE* fd; + fd = fopen(file, "at"); va_start(argptr, fmt); - vsprintf(data, fmt, argptr); + vfprintf (fd, fmt, argptr); va_end(argptr); - fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666); - write(fd, data, strlen(data)); - close(fd); + fclose(fd); }