From 00093d96e5a07c500f70119efb9f127d833fe71a Mon Sep 17 00:00:00 2001 From: Raphael Kubo da Costa Date: Sun, 19 May 2013 14:06:36 +0000 Subject: Patch multiple vulnerabilities in x11-toolkits/plib. PR: ports/178710 Submitted by: Denny Lin --- x11-toolkits/plib/Makefile | 2 +- .../plib/files/patch-src-ssg-ssgParser.cxx | 60 ++++++++++++++++++++++ x11-toolkits/plib/files/patch-src-util-ulError.cxx | 18 +++++++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 x11-toolkits/plib/files/patch-src-ssg-ssgParser.cxx create mode 100644 x11-toolkits/plib/files/patch-src-util-ulError.cxx (limited to 'x11-toolkits/plib') diff --git a/x11-toolkits/plib/Makefile b/x11-toolkits/plib/Makefile index 9c710f71ea73..142ab6c4e16f 100644 --- a/x11-toolkits/plib/Makefile +++ b/x11-toolkits/plib/Makefile @@ -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 --git a/x11-toolkits/plib/files/patch-src-ssg-ssgParser.cxx b/x11-toolkits/plib/files/patch-src-ssg-ssgParser.cxx new file mode 100644 index 000000000000..1894b32fe9af --- /dev/null +++ b/x11-toolkits/plib/files/patch-src-ssg-ssgParser.cxx @@ -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 --git a/x11-toolkits/plib/files/patch-src-util-ulError.cxx b/x11-toolkits/plib/files/patch-src-util-ulError.cxx new file mode 100644 index 000000000000..d04ec3170be0 --- /dev/null +++ b/x11-toolkits/plib/files/patch-src-util-ulError.cxx @@ -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 ) ; -- cgit v1.2.3