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

Fixed segfault occuring when loaded binary block turns out to be corrupt.

parent 285f36d4
No related branches found
No related tags found
No related merge requests found
......@@ -174,6 +174,7 @@ static struct sieve_interpreter *_sieve_interpreter_create
if ( !success ) {
sieve_interpreter_free(&interp);
interp = NULL;
} else {
interp->reset_vector = *address;
}
......@@ -185,8 +186,11 @@ struct sieve_interpreter *sieve_interpreter_create
(struct sieve_binary *sbin, const struct sieve_message_data *msgdata,
const struct sieve_script_env *senv, struct sieve_error_handler *ehandler)
{
struct sieve_binary_block *sblock =
sieve_binary_block_get(sbin, SBIN_SYSBLOCK_MAIN_PROGRAM);
struct sieve_binary_block *sblock;
if ( (sblock=sieve_binary_block_get(sbin, SBIN_SYSBLOCK_MAIN_PROGRAM))
== NULL )
return NULL;
return _sieve_interpreter_create(sbin, sblock, NULL, msgdata, senv, ehandler);
}
......@@ -196,10 +200,11 @@ struct sieve_interpreter *sieve_interpreter_create_for_block
const struct sieve_message_data *msgdata, const struct sieve_script_env *senv,
struct sieve_error_handler *ehandler)
{
struct sieve_binary *sbin = sieve_binary_block_get_binary(sblock);
if ( sblock == NULL ) return NULL;
return _sieve_interpreter_create
(sbin, sblock, script, msgdata, senv, ehandler);
(sieve_binary_block_get_binary(sblock), sblock, script, msgdata, senv,
ehandler);
}
void sieve_interpreter_free(struct sieve_interpreter **interp)
......
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.