testgltk / opengles-book-samples

Automatically exported from code.google.com/p/opengles-book-samples
0 stars 0 forks source link

The flaw of stack overflow in the function of esLogMessage #6

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Transfering a message longer than BUFSIZE bytes to esLogMessage make the 
stack overflow.

Solution:

///
// esLogMessage()
//
//    Log an error message to the debug output for the platform
//
void ESUTIL_API esLogMessage ( const char *formatStr, ... )
{
    va_list params;

    va_start ( params, formatStr );
    vfprintf ( stdout, formatStr, params );

    va_end ( params );
}

Original issue reported on code.google.com by homer.hs...@gmail.com on 16 Mar 2012 at 3:31