tpop3d-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tpop3d-discuss][PATCH] mailspool_load_index() has an off by one while i


From: Martin Blapp
Subject: [tpop3d-discuss][PATCH] mailspool_load_index() has an off by one while indexing.
Date: Tue, 24 Jan 2006 18:15:44 +0100 (CET)

mailspool_load_index() doesn't reduce m->num by one if !feof(fp).
This can result in an always broken indexfile and segfaults afterwords.

--- mailspool.c.orig    Tue Jan 24 14:21:10 2006
+++ mailspool.c Tue Jan 24 18:06:32 2006
@@ -960,6 +960,16 @@
     }

     if (!feof(fp)) {
+
+       --m->num;
+
log_print(LOG_WARNING, _("mailspool_load_index(%s): index exists, but has some stale or corrupt data"), indexfile);
         goto fail;
     }

I have examples here.

Thanks for fixing !

Martin

Martin Blapp, <address@hidden> <address@hidden>
------------------------------------------------------------------
ImproWare AG, UNIXSP & ISP, Zurlindenstrasse 29, 4133 Pratteln, CH
Phone: +41 61 826 93 00 Fax: +41 61 826 93 01
PGP: <finger -l address@hidden>
PGP Fingerprint: B434 53FC C87C FE7B 0A18 B84C 8686 EF22 D300 551E
------------------------------------------------------------------


reply via email to

[Prev in Thread] Current Thread [Next in Thread]