opnsense-ports/x11-toolkits/plib/files/patch-src-util-ulError.cxx
Franco Fichtner 8cb1a96ede ports: pull in a snapshot of the FreeBSD ports tree
Taken from:	https://github.com/freebsd/freebsd-ports.git
Commit id:	5070672073b68be364139bc6b3a89100bd17d331
2014-11-09 14:03:21 +01: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 ) ;