Skip to content
Snippets Groups Projects
Commit c752483a authored by Stephan Bosch's avatar Stephan Bosch
Browse files

Fixed segfault occuring when command did not exist.

parent 03c3f569
No related branches found
No related tags found
No related merge requests found
......@@ -750,7 +750,6 @@ static bool sieve_validate_command
enum sieve_ast_type ast_type = sieve_ast_node_type(cmd_node);
bool result = TRUE;
struct sieve_command_registration *cmd_reg;
const struct sieve_command *command;
i_assert( ast_type == SAT_TEST || ast_type == SAT_COMMAND );
......@@ -758,9 +757,10 @@ static bool sieve_validate_command
cmd_reg = sieve_validator_find_command_registration
(validator, cmd_node->identifier);
command = cmd_reg->command;
if ( command != NULL ) {
if ( cmd_reg != NULL && cmd_reg->command != NULL ) {
const struct sieve_command *command = cmd_reg->command;
/* Identifier = "" when the command was previously marked as unknown */
if ( *(command->identifier) != '\0' ) {
if ( (command->type == SCT_COMMAND && ast_type == SAT_TEST) ||
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment

Consent

On this website, we use the web analytics service Matomo to analyze and review the use of our website. Through the collected statistics, we can improve our offerings and make them more appealing for you. Here, you can decide whether to allow us to process your data and set corresponding cookies for these purposes, in addition to technically necessary cookies. Further information on data protection—especially regarding "cookies" and "Matomo"—can be found in our privacy policy. You can withdraw your consent at any time.