Skip to content
Snippets Groups Projects
Commit c3fca0a1 authored by Stephan Bosch's avatar Stephan Bosch Committed by timo.sirainen
Browse files

testsuite: Drop needless result reference in testsuite_run().

This holds a reference to the initial result, causing it to linger after
test_result_reset, thereby also holding a reference to the message context,
preventing it from being cleared. This in turn, can keep references to modified
message versions that cause the main message object to remain referenced. This
causes a panic in specific cases upon test_result_reset:

Panic: Input stream data unexpectedly has references
parent 4635acae
No related branches found
No related tags found
No related merge requests found
...@@ -69,9 +69,7 @@ testsuite_run(struct sieve_binary *sbin, struct sieve_error_handler *ehandler) ...@@ -69,9 +69,7 @@ testsuite_run(struct sieve_binary *sbin, struct sieve_error_handler *ehandler)
/* Run the interpreter */ /* Run the interpreter */
result = testsuite_result_get(); result = testsuite_result_get();
sieve_result_ref(result);
ret = sieve_interpreter_run(interp, result); ret = sieve_interpreter_run(interp, result);
sieve_result_unref(&result);
/* Free the interpreter */ /* Free the interpreter */
sieve_interpreter_free(&interp); sieve_interpreter_free(&interp);
......
require "vnd.dovecot.testsuite"; require "vnd.dovecot.testsuite";
require "include"; require "include";
require "variables"; require "variables";
require "editheader";
/*
* Testsuite self-test
*/
set "message" ".";
addheader "X-Some-Header" "Header content";
test_result_reset;
test_set "message" "${message}";
/* /*
* Multi script * Multi script
*/ */
test_result_reset;
test_set "message" text: test_set "message" text:
From: idiot@example.com From: idiot@example.com
To: idiot@example.org To: idiot@example.org
......
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.