]> granicus.if.org Git - mutt/commitdiff
fix segfault in pop driver. when rereading the message header, the ENVELOPE* struct...
authorhhorak <hhorak@redhat.com>
Tue, 18 Dec 2012 01:09:18 +0000 (17:09 -0800)
committerhhorak <hhorak@redhat.com>
Tue, 18 Dec 2012 01:09:18 +0000 (17:09 -0800)
http://pkgs.fedoraproject.org/cgit/mutt.git/tree/mutt-1.5.21-pophash.patch?h=f18

pop.c

diff --git a/pop.c b/pop.c
index 0c98942a812a042073af8328b70a8af66c63b0ac..9fa655432ba8484be368d454be038df19f4c65d0 100644 (file)
--- a/pop.c
+++ b/pop.c
@@ -618,8 +618,15 @@ int pop_fetch_message (MESSAGE* msg, CONTEXT* ctx, int msgno)
   }
   rewind (msg->fp);
   uidl = h->data;
+
+  /* we replace envelop, key in subj_hash has to be updated as well */
+  if (ctx->subj_hash && h->env->real_subj)
+    hash_delete (ctx->subj_hash, h->env->real_subj, h, NULL);
   mutt_free_envelope (&h->env);
   h->env = mutt_read_rfc822_header (msg->fp, h, 0, 0);
+  if (ctx->subj_hash && h->env->real_subj)
+    hash_insert (ctx->subj_hash, h->env->real_subj, h, 1);
+
   h->data = uidl;
   h->lines = 0;
   fgets (buf, sizeof (buf), msg->fp);