View Single Post
Re: Bug-NUM_FOR_EDICT Error: Bad Pointer
Old
  (#52)
Whistler
Summoner
 
Whistler's Avatar
 
Status: Offline
Posts: 1,499
Join Date: Feb 2004
Location: Mist Village
Default Re: Bug-NUM_FOR_EDICT Error: Bad Pointer - 15-05-2004

Quote:
Originally Posted by Pierre-Marie Baty
Code:
void TerminateOnError (const char *fmt, ...)
{
   va_list argptr;
   char string[1024];
 
   // concatenate all the arguments in one string
   va_start (argptr, fmt);
   vsprintf (string, fmt, argptr); // this isn't secure, and may cause buffer overrun.
   // I would suggest you change it to: _vsnprintf(string, sizeof(string), fmt, argptr);
   va_end (argptr);
......
}
...comments above