[Dovecot] Patch to fix leak in imap_refresh_proctitle in beta[5, 6]

Mike Abbott michael.abbott at apple.com
Thu Jun 17 02:07:37 EEST 2010


> I couldn't find anything obviously wrong in the code.

Figured it out.  The t_pop in client_handle_input was clobbering imap_clients->command_queue->name.  This is because cmd_uid allocated the name from the wrong pool.  Here is a patch to fix it.  Forget my other patch (to imap_refresh_proctitle).
--- a/src/imap/cmd-uid.c	(beta5)
+++ b/src/imap/cmd-uid.c	(working copy)
@@ -20,7 +20,7 @@
 		return TRUE;
 	}
 
-	cmd->name = t_strconcat("UID ", cmd_name, NULL);
+	cmd->name = p_strconcat(cmd->pool, "UID ", cmd_name, NULL);
 	cmd->cmd_flags = command->flags;
 	cmd->func = command->func;
 	cmd->uid = TRUE;

Incidentally, this line in client_command_input is puzzling.  Comparing a pointer to a character?
	if (cmd->name == '\0') {



More information about the dovecot mailing list