Fix potential buffer overflow in debug functions.

This resolves issue #70.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
(cherry picked from commit a9d178f100)
r14.1.x
Slávek Banko 11 months ago
parent f30ac87a4f
commit 1c30858477
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -520,7 +520,7 @@ void tqDebug( const char *msg, ... )
va_list ap;
va_start( ap, msg ); // use variable arg list
#if defined(QT_VSNPRINTF)
QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH, msg, ap );
QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH-len, msg, ap );
#else
vsprintf( &buf[len], msg, ap );
#endif
@ -555,7 +555,7 @@ void tqWarning( const char *msg, ... )
va_list ap;
va_start( ap, msg ); // use variable arg list
#if defined(QT_VSNPRINTF)
QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH, msg, ap );
QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH-len, msg, ap );
#else
vsprintf( &buf[len], msg, ap );
#endif
@ -590,7 +590,7 @@ void tqFatal( const char *msg, ... )
va_list ap;
va_start( ap, msg ); // use variable arg list
#if defined(QT_VSNPRINTF)
QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH, msg, ap );
QT_VSNPRINTF( &buf[len], QT_BUFFER_LENGTH-len, msg, ap );
#else
vsprintf( &buf[len], msg, ap );
#endif

Loading…
Cancel
Save