Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory safety issue in slistartup.cc #3272

Merged
merged 5 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading