dovecot-1.1: Don't access freed memory.

dovecot at dovecot.org dovecot at dovecot.org
Thu Mar 20 16:27:03 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/9b8590b3749b
changeset: 7432:9b8590b3749b
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Mar 20 16:26:59 2008 +0200
description:
Don't access freed memory.

diffstat:

1 file changed, 4 insertions(+), 2 deletions(-)
src/imap/imap-sync.c |    6 ++++--

diffs (23 lines):

diff -r 33d8adcc2d44 -r 9b8590b3749b src/imap/imap-sync.c
--- a/src/imap/imap-sync.c	Thu Mar 20 16:26:27 2008 +0200
+++ b/src/imap/imap-sync.c	Thu Mar 20 16:26:59 2008 +0200
@@ -210,7 +210,7 @@ static bool cmd_finish_sync(struct clien
 
 static bool cmd_sync_continue(struct client_command_context *sync_cmd)
 {
-	struct client_command_context *cmd;
+	struct client_command_context *cmd, *next;
 	struct client *client = sync_cmd->client;
 	struct imap_sync_context *ctx = sync_cmd->context;
 	int ret;
@@ -230,7 +230,9 @@ static bool cmd_sync_continue(struct cli
 	sync_cmd->context = NULL;
 
 	/* finish all commands that waited for this sync */
-	for (cmd = client->command_queue; cmd != NULL; cmd = cmd->next) {
+	for (cmd = client->command_queue; cmd != NULL; cmd = next) {
+		next = cmd->next;
+
 		if (cmd->state == CLIENT_COMMAND_STATE_WAIT_SYNC &&
 		    cmd != sync_cmd &&
 		    cmd->sync->counter+1 == client->sync_counter) {


More information about the dovecot-cvs mailing list