[poppler] 2 commits - poppler/GfxState.cc poppler/JPEG2000Stream.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Aug 25 12:10:42 PDT 2009


 poppler/GfxState.cc       |    3 ++-
 poppler/JPEG2000Stream.cc |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 4f6016d01ced32002bef22b9b5d5426a74e55842
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Aug 25 21:10:07 2009 +0200

    Fix format security warnings
    
    Don't just directly print strings of unknown content; use "%s".

diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc
index f3f0f9e..d3624c8 100644
--- a/poppler/JPEG2000Stream.cc
+++ b/poppler/JPEG2000Stream.cc
@@ -86,11 +86,11 @@ void JPXStream::init()
 }
 
 static void libopenjpeg_error_callback(const char *msg, void * /*client_data*/) {
-  error(-1, (char*)msg);
+  error(-1, "%s", msg);
 }
 
 static void libopenjpeg_warning_callback(const char *msg, void * /*client_data*/) {
-  error(-1, (char*)msg);
+  error(-1, "%s", msg);
 }
 
 void JPXStream::init2(unsigned char *buf, int bufLen, OPJ_CODEC_FORMAT format)
commit 4616b23382b5d155f8b2f1942733037cf5730844
Author: Christian Persch <chpe at gnome.org>
Date:   Tue Aug 25 21:09:40 2009 +0200

    Fix format security warnings
    
    Don't just directly print strings of unknown content; use "%s".

diff --git a/poppler/GfxState.cc b/poppler/GfxState.cc
index 6dc9221..8595455 100644
--- a/poppler/GfxState.cc
+++ b/poppler/GfxState.cc
@@ -19,6 +19,7 @@
 // Copyright (C) 2006-2009 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2009 Koji Otani <sho at bbr.jp>
 // Copyright (C) 2009 Thomas Freitag <Thomas.Freitag at alfa.de>
+// Copyright (C) 2009 Christian Persch <chpe at gnome.org>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -301,7 +302,7 @@ cmsHPROFILE loadColorProfile(const char *fileName)
 
 static int CMSError(int ecode, const char *msg)
 {
-    error(-1,const_cast<char *>(msg));
+    error(-1, "%s", msg);
     return 1;
 }
 


More information about the poppler mailing list