#159 gpsim-0.27.0/src/ValueCollections.h: returning invalid pointer ?

None
closed-fixed
None
5
2014-05-17
2013-10-03
Anonymous
No

I just ran the static analysis checker "cppcheck" over the source
code of gpsim-0.27.0

It said

[ValueCollections.h:262]: (error) Dangerous usage of c_str(). The value returned
by c_str() is invalid after throwing exception.

Source code is

else {
  string sMsg;
  sMsg = "Indexer expression does not evaluate to an Integer for " + name(); 
  throw sMsg.c_str();
}

Suggest code rework

Discussion

  • Roy Rankin

    Roy Rankin - 2014-05-17

    Fixed svn 2259

     
  • Roy Rankin

    Roy Rankin - 2014-05-17
    • status: open --> closed-fixed
    • assigned_to: Roy Rankin
    • Group: -->
     


Anonymous

Cancel  Add attachments





Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks