Skip to content

Commit

Permalink
Merge pull request #3272 from heshpdx/master
Browse files Browse the repository at this point in the history
Fix memory safety issue in slistartup.cc
  • Loading branch information
heplesser authored Aug 19, 2024
2 parents 28ef5c4 + d45c5e4 commit ff2f667
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion nestkernel/connection_creator_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ ConnectionCreator::PoolWrapper_< D >::PoolWrapper_()
}

template < int D >
ConnectionCreator::PoolWrapper_< D >::~PoolWrapper_()
ConnectionCreator::PoolWrapper_< D >::~PoolWrapper_< D >()
{
if ( masked_layer_ )
{
Expand Down
6 changes: 5 additions & 1 deletion sli/parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

class Parser
{
Scanner* s;
Scanner* s = nullptr;

Token arraytoken;
Token proctoken;
Expand All @@ -61,6 +61,10 @@ class Parser
public:
Parser();
Parser( std::istream& );
~Parser()
{
delete s;
}

bool operator()( Token& );
bool
Expand Down
22 changes: 12 additions & 10 deletions sli/slistartup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -214,53 +214,55 @@ SLIStartup::SLIStartup( int argc, char** argv )
StringDatum* sd = new StringDatum( argv[ i ] );
args_array.push_back( Token( sd ) );

if ( *sd == "-d" or *sd == "--debug" )
const std::string myarg = argv[ i ];

if ( myarg == "-d" or myarg == "--debug" )
{
debug_ = true;
verbosity_ = SLIInterpreter::M_ALL; // make the interpreter verbose.
continue;
}
if ( *sd == "--verbosity=ALL" )
if ( myarg == "--verbosity=ALL" )
{
verbosity_ = SLIInterpreter::M_ALL;
continue;
}
if ( *sd == "--verbosity=DEBUG" )
if ( myarg == "--verbosity=DEBUG" )
{
verbosity_ = SLIInterpreter::M_DEBUG;
continue;
}
if ( *sd == "--verbosity=STATUS" )
if ( myarg == "--verbosity=STATUS" )
{
verbosity_ = SLIInterpreter::M_STATUS;
continue;
}
if ( *sd == "--verbosity=INFO" )
if ( myarg == "--verbosity=INFO" )
{
verbosity_ = SLIInterpreter::M_INFO;
continue;
}
if ( *sd == "--verbosity=DEPRECATED" )
if ( myarg == "--verbosity=DEPRECATED" )
{
verbosity_ = SLIInterpreter::M_DEPRECATED;
continue;
}
if ( *sd == "--verbosity=WARNING" )
if ( myarg == "--verbosity=WARNING" )
{
verbosity_ = SLIInterpreter::M_WARNING;
continue;
}
if ( *sd == "--verbosity=ERROR" )
if ( myarg == "--verbosity=ERROR" )
{
verbosity_ = SLIInterpreter::M_ERROR;
continue;
}
if ( *sd == "--verbosity=FATAL" )
if ( myarg == "--verbosity=FATAL" )
{
verbosity_ = SLIInterpreter::M_FATAL;
continue;
}
if ( *sd == "--verbosity=QUIET" )
if ( myarg == "--verbosity=QUIET" )
{
verbosity_ = SLIInterpreter::M_QUIET;
continue;
Expand Down

0 comments on commit ff2f667

Please sign in to comment.