diff options
author | rakuco <rakuco@FreeBSD.org> | 2013-05-19 22:06:36 +0800 |
---|---|---|
committer | rakuco <rakuco@FreeBSD.org> | 2013-05-19 22:06:36 +0800 |
commit | ffa8e0b0f6c24a3828dabac99ca5c94ef520bd75 (patch) | |
tree | 762a0401a70ea57e1461e1924e78e4af757b564b /x11-toolkits/plib | |
parent | af1d9e46f9e0c23e000f979a4e4d6b6a567807be (diff) | |
download | freebsd-ports-gnome-ffa8e0b0f6c24a3828dabac99ca5c94ef520bd75.tar.gz freebsd-ports-gnome-ffa8e0b0f6c24a3828dabac99ca5c94ef520bd75.tar.zst freebsd-ports-gnome-ffa8e0b0f6c24a3828dabac99ca5c94ef520bd75.zip |
Patch multiple vulnerabilities in x11-toolkits/plib.
PR: ports/178710
Submitted by: Denny Lin <dennylin93@hs.ntnu.edu.tw>
Diffstat (limited to 'x11-toolkits/plib')
-rw-r--r-- | x11-toolkits/plib/Makefile | 2 | ||||
-rw-r--r-- | x11-toolkits/plib/files/patch-src-ssg-ssgParser.cxx | 60 | ||||
-rw-r--r-- | x11-toolkits/plib/files/patch-src-util-ulError.cxx | 18 |
3 files changed, 79 insertions, 1 deletions
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 ) ; |