ports/x11-toolkits/plib/files/patch-src-util-ulError.cxx
Raphael Kubo da Costa 00093d96e5 Patch multiple vulnerabilities in x11-toolkits/plib.
PR:		ports/178710
Submitted by:	Denny Lin <dennylin93@hs.ntnu.edu.tw>
2013-05-19 14:06:36 +00:00

18 lines
531 B
C++

Index: src/util/ulError.cxx
===================================================================
--- src/util/ulError.cxx.orig
+++ src/util/ulError.cxx
@@ -39,9 +39,11 @@ void ulSetError ( enum ulSeverity severi
{
va_list argp;
va_start ( argp, fmt ) ;
- vsprintf ( _ulErrorBuffer, fmt, argp ) ;
+ vsnprintf ( _ulErrorBuffer, sizeof(_ulErrorBuffer)-1, fmt, argp ) ;
va_end ( argp ) ;
-
+
+ _ulErrorBuffer[sizeof(_ulErrorBuffer)-1] = '\0';
+
if ( _ulErrorCB )
{
(*_ulErrorCB)( severity, _ulErrorBuffer ) ;