dovecot-2.0-pigeonhole: variables extension: fixed segfault bug ...
pigeonhole at rename-it.nl
pigeonhole at rename-it.nl
Sun Sep 11 01:41:11 EEST 2011
details: http://hg.rename-it.nl/dovecot-2.0-pigeonhole/rev/75bb6c3f4176
changeset: 1522:75bb6c3f4176
user: Stephan Bosch <stephan at rename-it.nl>
date: Sun Sep 11 00:19:07 2011 +0200
description:
variables extension: fixed segfault bug triggered when dumping binary variable scopes.
diffstat:
src/lib-sieve/plugins/include/ext-include-common.c | 2 +-
src/lib-sieve/plugins/variables/ext-variables-common.c | 18 ++++++++++--------
src/lib-sieve/plugins/variables/ext-variables-dump.c | 3 ++-
src/lib-sieve/plugins/variables/sieve-ext-variables.h | 4 ++--
4 files changed, 15 insertions(+), 12 deletions(-)
diffs (125 lines):
diff -r 2b7f00ea1062 -r 75bb6c3f4176 src/lib-sieve/plugins/include/ext-include-common.c
--- a/src/lib-sieve/plugins/include/ext-include-common.c Mon Aug 29 17:33:00 2011 +0200
+++ b/src/lib-sieve/plugins/include/ext-include-common.c Sun Sep 11 00:19:07 2011 +0200
@@ -164,7 +164,7 @@
sieve_variable_scope_ref(actx->global_vars);
} else {
- actx->global_vars = sieve_variable_scope_create(this_ext);
+ actx->global_vars = sieve_variable_scope_create(this_ext->svinst, this_ext);
}
sieve_ast_extension_register
diff -r 2b7f00ea1062 -r 75bb6c3f4176 src/lib-sieve/plugins/variables/ext-variables-common.c
--- a/src/lib-sieve/plugins/variables/ext-variables-common.c Mon Aug 29 17:33:00 2011 +0200
+++ b/src/lib-sieve/plugins/variables/ext-variables-common.c Sun Sep 11 00:19:07 2011 +0200
@@ -42,10 +42,11 @@
pool_t pool;
int refcount;
+ struct sieve_instance *svinst;
+ const struct sieve_extension *ext;
+
struct sieve_variable *error_var;
- const struct sieve_extension *ext;
-
struct hash_table *variables;
ARRAY_DEFINE(variable_index, struct sieve_variable *);
};
@@ -64,7 +65,7 @@
};
struct sieve_variable_scope *sieve_variable_scope_create
-(const struct sieve_extension *ext)
+(struct sieve_instance *svinst, const struct sieve_extension *ext)
{
struct sieve_variable_scope *scope;
pool_t pool;
@@ -74,6 +75,7 @@
scope->pool = pool;
scope->refcount = 1;
+ scope->svinst = svinst;
scope->ext = ext;
scope->variables = hash_table_create
@@ -234,7 +236,7 @@
/* Scope binary */
struct sieve_variable_scope *sieve_variable_scope_binary_dump
-(const struct sieve_extension *ext,
+(struct sieve_instance *svinst, const struct sieve_extension *ext,
const struct sieve_dumptime_env *denv, sieve_size_t *address)
{
struct sieve_variable_scope *local_scope;
@@ -253,7 +255,7 @@
return FALSE;
/* Create scope */
- local_scope = sieve_variable_scope_create(ext);
+ local_scope = sieve_variable_scope_create(svinst, ext);
/* Read and dump scope itself */
@@ -336,7 +338,7 @@
}
/* Create scope */
- scope = sieve_variable_scope_create(ext);
+ scope = sieve_variable_scope_create(svinst, ext);
scpbin = sieve_variable_scope_binary_create(scope);
scpbin->size = scope_size;
@@ -352,7 +354,7 @@
(struct sieve_variable_scope_binary *scpbin)
{
const struct sieve_extension *ext = scpbin->scope->ext;
- struct sieve_instance *svinst = ext->svinst;
+ struct sieve_instance *svinst = scpbin->scope->svinst;
const char *ext_name =
( ext == NULL ? "variables" : sieve_extension_name(ext) );
unsigned int i;
@@ -551,7 +553,7 @@
{
struct sieve_variable_scope *scope;
- scope = sieve_variable_scope_create(NULL);
+ scope = sieve_variable_scope_create(this_ext->svinst, NULL);
sieve_ast_extension_register
(ast, this_ext, &variables_ast_extension, (void *) scope);
diff -r 2b7f00ea1062 -r 75bb6c3f4176 src/lib-sieve/plugins/variables/ext-variables-dump.c
--- a/src/lib-sieve/plugins/variables/ext-variables-dump.c Mon Aug 29 17:33:00 2011 +0200
+++ b/src/lib-sieve/plugins/variables/ext-variables-dump.c Sun Sep 11 00:19:07 2011 +0200
@@ -73,7 +73,8 @@
struct ext_variables_dump_context *dctx;
struct sieve_variable_scope *local_scope;
- local_scope = sieve_variable_scope_binary_dump(NULL, denv, address);
+ local_scope = sieve_variable_scope_binary_dump
+ (ext->svinst, NULL, denv, address);
dctx = ext_variables_dump_get_context(ext, denv);
dctx->local_scope = local_scope;
diff -r 2b7f00ea1062 -r 75bb6c3f4176 src/lib-sieve/plugins/variables/sieve-ext-variables.h
--- a/src/lib-sieve/plugins/variables/sieve-ext-variables.h Mon Aug 29 17:33:00 2011 +0200
+++ b/src/lib-sieve/plugins/variables/sieve-ext-variables.h Sun Sep 11 00:19:07 2011 +0200
@@ -63,7 +63,7 @@
struct sieve_variable_scope;
struct sieve_variable_scope *sieve_variable_scope_create
- (const struct sieve_extension *ext);
+ (struct sieve_instance *svinst, const struct sieve_extension *ext);
void sieve_variable_scope_ref
(struct sieve_variable_scope *scope);
void sieve_variable_scope_unref
@@ -91,7 +91,7 @@
(struct sieve_variable_scope_binary **scpbin);
struct sieve_variable_scope *sieve_variable_scope_binary_dump
- (const struct sieve_extension *ext,
+ (struct sieve_instance *svinst, const struct sieve_extension *ext,
const struct sieve_dumptime_env *denv, sieve_size_t *address);
struct sieve_variable_scope_binary *sieve_variable_scope_binary_read
(struct sieve_instance *svinst, const struct sieve_extension *ext,
More information about the dovecot-cvs
mailing list