[CoinUtils-tickets] [COIN-OR Common Utilities] #80: fix to compile with -Werror=format-security

COIN-OR Common Utilities coin-trac at coin-or.org
Mon Aug 5 23:44:57 EDT 2013


#80: fix to compile with -Werror=format-security
-------------------+-------------------
Reporter:  mlubin  |      Type:  defect
  Status:  new     |  Priority:  minor
 Version:          |  Keywords:
-------------------+-------------------
 I'm working on updating the Debian package for coinutils, and they now
 strongly encourage compiling with `-Werror=format-security`. This short
 patch is required to make this work.


 {{{
 --- a/CoinUtils/src/CoinMessageHandler.cpp
 +++ b/CoinUtils/src/CoinMessageHandler.cpp
 @@ -820,7 +820,7 @@
           sprintf(messageOut_,g_format_,doublevalue);
           if (next != format_+2) {
             messageOut_+=strlen(messageOut_);
 -           sprintf(messageOut_,format_+2);
 +           strcpy(messageOut_,format_+2);
           }
         }
         messageOut_+=strlen(messageOut_);
 }}}

-- 
Ticket URL: <https://projects.coin-or.org/CoinUtils/ticket/80>
COIN-OR Common Utilities <http://projects.coin-or.org/CoinUtils>
Common data structures and linear algebra functions for COIN-OR projects



More information about the CoinUtils-tickets mailing list