git.iko.soy/typeable/nixpkgs
on master help sign in
plib: fix CVE-2012-4552 (close #12195)

patch source: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=694810#10

commit90b853b70698c2b9a6ab5ce814263a417aa80bdf authorJakob Gillich <jakob@gillich.me> dateThu 7 Jan 2016, 05:42 (11 years ago) parent4f4eebb
2 files changed+57
pkgs/development/libraries/plib/CVE-2012-4552.patch+55 pkgs/development/libraries/plib/default.nix+2
pkgs/development/libraries/plib/CVE-2012-4552.patchnew file+55
@@ -0,0 +1,55 @@
1+diff -up plib-1.8.5/src/ssg/ssgParser.cxx~ plib-1.8.5/src/ssg/ssgParser.cxx
2+--- plib-1.8.5/src/ssg/ssgParser.cxx~ 2008-03-11 03:06:23.000000000 +0100
3++++ plib-1.8.5/src/ssg/ssgParser.cxx 2012-11-01 15:33:12.424483374 +0100
4+@@ -57,18 +57,16 @@ void _ssgParser::error( const char *form
5+ char msgbuff[ 255 ];
6+ va_list argp;
7+
8+- char* msgptr = msgbuff;
9+- if (linenum)
10+- {
11+- msgptr += sprintf ( msgptr,"%s, line %d: ",
12+- path, linenum );
13+- }
14+-
15+ va_start( argp, format );
16+- vsprintf( msgptr, format, argp );
17++ vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
18+ va_end( argp );
19+
20+- ulSetError ( UL_WARNING, "%s", msgbuff ) ;
21++ if (linenum)
22++ {
23++ ulSetError ( UL_WARNING, "%s, line %d: %s", path, linenum, msgbuff ) ;
24++ } else {
25++ ulSetError ( UL_WARNING, "%s", msgbuff ) ;
26++ }
27+ }
28+
29+
30+@@ -78,18 +76,16 @@ void _ssgParser::message( const char *fo
31+ char msgbuff[ 255 ];
32+ va_list argp;
33+
34+- char* msgptr = msgbuff;
35+- if (linenum)
36+- {
37+- msgptr += sprintf ( msgptr,"%s, line %d: ",
38+- path, linenum );
39+- }
40+-
41+ va_start( argp, format );
42+- vsprintf( msgptr, format, argp );
43++ vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
44+ va_end( argp );
45+
46+- ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
47++ if (linenum)
48++ {
49++ ulSetError ( UL_DEBUG, "%s, line %d: %s", path, linenum, msgbuff ) ;
50++ } else {
51++ ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
52++ }
53+ }
54+
55+ // Opens the file and does a few internal calculations based on the spec.
pkgs/development/libraries/plib/default.nix+2
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
1111 sha256 = "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8";
1212 };
1313
14+ patches = [ ./CVE-2012-4552.patch ];
15+
1416 NIX_CFLAGS_COMPILE = if enablePIC then "-fPIC" else "";
1517
1618 propagatedBuildInputs = [