* if the Msg read seem invalid, don't add it to our list.
authorWilfried Göesgens <willi@citadel.org>
Tue, 16 Jun 2009 21:11:50 +0000 (21:11 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 16 Jun 2009 21:11:50 +0000 (21:11 +0000)
webcit/messages.c

index cad2773d95c82d54d386f18a1cca6f36a2b3ce82..485f23d7a852757c3bdf070f84573661667c5d29 100644 (file)
@@ -609,6 +609,11 @@ int load_msg_ptrs(const char *servcmd, int with_headers)
 
                        Msg->msgnum = StrBufExtractNext_long(Buf, &Ptr, '|');
                        Msg->date = StrBufExtractNext_long(Buf, &Ptr, '|');
+
+                       if ((Msg->msgnum == 0) && (StrLength(Buf) < 32)) {
+                               free(Msg);
+                               continue;
+                       }
                        /* 
                         * as citserver probably gives us messages in forward date sorting
                         * nummsgs should be the same order as the message date.