diff options
author | Don Lewis <truckman@apache.org> | 2016-08-31 16:12:32 +0000 |
---|---|---|
committer | Don Lewis <truckman@apache.org> | 2016-08-31 16:12:32 +0000 |
commit | 7204bffa5c633d7bc2064e3c643dbacfab79e281 (patch) | |
tree | f29dd0ae5a5c7cdfc79a9df459040ee344321c4f /svtools | |
parent | e64b208bc03ba75fcc353d5f55d19666cda390d8 (diff) |
Fix -Wformat-security warnings.
There are a number of instances where the code calls *printf() to
print arbitrary strings and the string is passed as the format
argument to *printf(). Since these strings might contain %
conversion sequences, this is a security hazard. Fix the problem
by printing the strings with a "%s" format.
Notes
Notes:
prefer: e456a0804052a0ad0a4daef4fad9c5205bd7aa60
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/bmpmaker/bmp.cxx | 2 | ||||
-rw-r--r-- | svtools/bmpmaker/bmpsum.cxx | 2 | ||||
-rw-r--r-- | svtools/bmpmaker/g2g.cxx | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/svtools/bmpmaker/bmp.cxx b/svtools/bmpmaker/bmp.cxx index 59ea14bfcbd1..4ef153eb98bc 100644 --- a/svtools/bmpmaker/bmp.cxx +++ b/svtools/bmpmaker/bmp.cxx @@ -157,7 +157,7 @@ void BmpApp::Message( const String& rText, sal_uInt8 cExit ) ByteString aText( rText, RTL_TEXTENCODING_UTF8 ); aText.Append( "\r\n" ); - fprintf( stderr, aText.GetBuffer() ); + fprintf( stderr, "%s", aText.GetBuffer() ); } // ----------------------------------------------------------------------------- diff --git a/svtools/bmpmaker/bmpsum.cxx b/svtools/bmpmaker/bmpsum.cxx index 8f88bcd6e262..e7d50b424a62 100644 --- a/svtools/bmpmaker/bmpsum.cxx +++ b/svtools/bmpmaker/bmpsum.cxx @@ -160,7 +160,7 @@ void BmpSum::Message( const String& rText, sal_uInt8 nExitCode ) ByteString aText( rText, RTL_TEXTENCODING_UTF8 ); aText.Append( "\r\n" ); - fprintf( stderr, aText.GetBuffer() ); + fprintf( stderr, "%s", aText.GetBuffer() ); } // ----------------------------------------------------------------------------- diff --git a/svtools/bmpmaker/g2g.cxx b/svtools/bmpmaker/g2g.cxx index 02167ebd1d75..3d10e3845cce 100644 --- a/svtools/bmpmaker/g2g.cxx +++ b/svtools/bmpmaker/g2g.cxx @@ -121,7 +121,7 @@ void G2GApp::Message( const String& rText, sal_uInt8 nExitCode ) ByteString aText( rText, RTL_TEXTENCODING_UTF8 ); aText.Append( "\r\n" ); - fprintf( stderr, aText.GetBuffer() ); + fprintf( stderr, "%s", aText.GetBuffer() ); } // ----------------------------------------------------------------------------- |