On 02/12/2014 11:05 AM, Ralf Hildebrandt wrote:
> pop3 keeps crashing with a sigsegv in that version. Gotta go back.
>
> Feb 12 10:02:52 postamt dovecot: pop3(mhippler) LJZ31jHyygAKK4EU:
> Fatal: master: service(pop3): child 14635 killed with signal 11 (core
> dumped)
>
> Feb 12 10:02:54 postamt dovecot: pop3(fem-qm-sfb) HlCP1jHyGgCNKtkP:
> Fatal: master: service(pop3): child 14692 killed with signal 11 (core
> dumped)
Hello
Please find attached a patch that addresses this problem. Apply on top of
2.2.11 sources with hg import <path-to-patch>.
br,
Teemu Huovila
# HG changeset patch
# Parent e64959d20105582632fbc933f55e5a31f73b8a72
pop3: Access sequence numbers correctly.
diff --git a/src/pop3/pop3-commands.c b/src/pop3/pop3-commands.c
--- a/src/pop3/pop3-commands.c
+++ b/src/pop3/pop3-commands.c
@@ -248,25 +248,25 @@ bool client_update_mails(struct client *
/* translate msgnums to sequences (in case POP3 ordering is
different) */
t_array_init(&deleted_msgs, 8);
if (client->deleted_bitmask != NULL) {
for (msgnum = 0; msgnum < client->messages_count; msgnum++) {
bit = 1 << (msgnum % CHAR_BIT);
if ((client->deleted_bitmask[msgnum / CHAR_BIT] & bit) != 0)
- seq_range_array_add(&deleted_msgs, client->msgnum_to_seq_map[msgnum]);
+ seq_range_array_add(&deleted_msgs, msgnum_to_seq(client,msgnum));
}
}
t_array_init(&seen_msgs, 8);
if (client->seen_bitmask != NULL) {
for (msgnum = 0; msgnum < client->messages_count; msgnum++) {
bit = 1 << (msgnum % CHAR_BIT);
if ((client->seen_bitmask[msgnum / CHAR_BIT] & bit) != 0)
- seq_range_array_add(&seen_msgs, client->msgnum_to_seq_map[msgnum]);
+ seq_range_array_add(&seen_msgs, msgnum_to_seq(client,msgnum));
}
}
search_args = pop3_search_build(client, 0);
ctx = mailbox_search_init(client->trans, search_args, NULL, 0, NULL);
mail_search_args_unref(&search_args);
msgnum = 0;
@@ -821,17 +821,17 @@ static void client_uidls_save(struct cli
i_free(seq_uidls);
return;
}
/* map UIDLs to msgnums (in case POP3 sort ordering is different) */
client->message_uidls = p_new(client->uidl_pool, const char *,
client->messages_count+1);
for (msgnum = 0; msgnum < client->messages_count; msgnum++) {
client->message_uidls[msgnum] =
- seq_uidls[client->msgnum_to_seq_map[msgnum]];
+ seq_uidls[msgnum_to_seq(client,msgnum)];
}
i_free(seq_uidls);
}
static struct cmd_uidl_context *
cmd_uidl_init(struct client *client, uint32_t seq)
{
struct cmd_uidl_context *ctx;