]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-lua: Fix accesing freed memory if Lua script leaks passthrough event
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 9 Feb 2026 10:26:08 +0000 (12:26 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 9 Feb 2026 10:26:08 +0000 (12:26 +0200)
Broken by a487559b11294c1c519a64dd42a970456e1493a0

src/lib-lua/dlua-dovecot.c

index e5cea042b4a941407b569df8ca3adb9d1f27321c..ebe2e89c828e1e1895bef0760f3bbee7ca9bde34 100644 (file)
@@ -490,7 +490,7 @@ void dlua_event_passthrough_abort(struct dlua_script *script)
        if (script->pending_event_passthrough != NULL) {
                struct event *event =
                        script->pending_event_passthrough->event();
-               const char *source_filename = event->source_filename;
+               const char *source_filename = t_strdup(event->source_filename);
                int source_linenum = event->source_linenum;
                event_send_abort(event);
                script->pending_event_passthrough = NULL;