diff -ruN plib.orig/Makefile plib/Makefile --- plib.orig/Makefile 2013-05-17 15:40:24.000000000 +0800 +++ plib/Makefile 2013-05-17 15:43:58.000000000 +0800 @@ -7,7 +7,7 @@ PORTNAME= plib PORTVERSION= 1.8.5 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= x11-toolkits MASTER_SITES= http://plib.sourceforge.net/dist/ diff -ruN plib.orig/files/patch-src-ssg-ssgParser.cxx plib/files/patch-src-ssg-ssgParser.cxx --- plib.orig/files/patch-src-ssg-ssgParser.cxx 1970-01-01 08:00:00.000000000 +0800 +++ plib/files/patch-src-ssg-ssgParser.cxx 2013-05-17 15:43:10.000000000 +0800 @@ -0,0 +1,60 @@ +Index: src/ssg/ssgParser.cxx +=================================================================== +--- src/ssg/ssgParser.cxx.orig ++++ src/ssg/ssgParser.cxx +@@ -57,18 +57,18 @@ void _ssgParser::error( const char *form + char msgbuff[ 255 ]; + va_list argp; + +- char* msgptr = msgbuff; +- if (linenum) +- { +- msgptr += sprintf ( msgptr,"%s, line %d: ", +- path, linenum ); +- } +- + va_start( argp, format ); +- vsprintf( msgptr, format, argp ); ++ vsnprintf( msgbuff, sizeof(msgbuff)-1, format, argp ); + va_end( argp ); ++ ++ msgbuff[sizeof(msgbuff)-1] = '\0'; + +- ulSetError ( UL_WARNING, "%s", msgbuff ) ; ++ if (linenum) ++ { ++ ulSetError ( UL_WARNING, "%s, line %d: %s", path, linenum, msgbuff ) ; ++ } else { ++ ulSetError ( UL_WARNING, "%s", msgbuff ) ; ++ } + } + + +@@ -78,18 +78,18 @@ void _ssgParser::message( const char *fo + char msgbuff[ 255 ]; + va_list argp; + +- char* msgptr = msgbuff; +- if (linenum) +- { +- msgptr += sprintf ( msgptr,"%s, line %d: ", +- path, linenum ); +- } +- + va_start( argp, format ); +- vsprintf( msgptr, format, argp ); ++ vsnprintf( msgbuff, sizeof(msgbuff)-1, format, argp ); + va_end( argp ); ++ ++ msgbuff[sizeof(msgbuff)-1] = '\0'; + +- ulSetError ( UL_DEBUG, "%s", msgbuff ) ; ++ if (linenum) ++ { ++ ulSetError ( UL_DEBUG, "%s, line %d: %s", path, linenum, msgbuff ) ; ++ } else { ++ ulSetError ( UL_DEBUG, "%s", msgbuff ) ; ++ } + } + + // Opens the file and does a few internal calculations based on the spec. diff -ruN plib.orig/files/patch-src-util-ulError.cxx plib/files/patch-src-util-ulError.cxx --- plib.orig/files/patch-src-util-ulError.cxx 1970-01-01 08:00:00.000000000 +0800 +++ plib/files/patch-src-util-ulError.cxx 2013-05-17 15:43:12.000000000 +0800 @@ -0,0 +1,18 @@ +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 ) ;