[Libreoffice] [PATCH] security issue: using an un-sanitized string as format of a fprintf

Norbert Thiebaud nthiebaud at gmail.com
Sun Oct 3 00:02:04 PDT 2010


security issue: using an un-sanitized string as format of a fprintf

the argument of fprintf, from aSrsName, come from a command line.
It can contain %s or any other kind of formatting instruction that
could be use to do evil things at run-time



diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx
index ecdde6a..832f358 100644
--- a/rsc/source/prj/start.cxx
+++ b/rsc/source/prj/start.cxx
@@ -258,7 +258,7 @@ static BOOL CallRsc2( ByteString aRsc2Name,
 #ifdef OS2
         fprintf( fRspFile, "%s\n", aSrsName.GetBuffer() );
 #else
-        fprintf( fRspFile, aSrsName.GetBuffer() );
+        fprintf( fRspFile, "%s", aSrsName.GetBuffer() );
 #endif

         pString = pInputList->First();


More information about the LibreOffice mailing list