Skip to content

Commit

Permalink
messages: prevent std::string from being initialized with nullptr
Browse files Browse the repository at this point in the history
Fixes #1184: Using syslog or an invalid message type crashes a daemon

Do not use NULL or nullptr as const string& argument for ScanTypes
in case of an invalid destination string or for the syslog message destination
  • Loading branch information
franku committed Feb 11, 2020
1 parent 07e70fe commit 439b6f0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/src/lib/res.cc
Expand Up @@ -313,14 +313,14 @@ void ConfigurationParser::StoreMsgs(LEX* lc,
token = LexGetToken(lc, BCT_SKIP_EOL);

ScanTypes(lc, message_resource,
static_cast<MessageDestinationCode>(item->code), dest, NULL,
NULL);
static_cast<MessageDestinationCode>(item->code), dest,
std::string(), std::string());
FreePoolMemory(dest);
Dmsg0(900, "done with dest codes\n");
} else {
ScanTypes(lc, message_resource,
static_cast<MessageDestinationCode>(item->code), NULL, NULL,
NULL);
static_cast<MessageDestinationCode>(item->code),
std::string(), std::string(), std::string());
}
break;
}
Expand Down

0 comments on commit 439b6f0

Please sign in to comment.