From fa73f71e952b8413f24f2b0719cd8799279f681a Mon Sep 17 00:00:00 2001 From: Daniel Applebaum Date: Thu, 18 Mar 2010 03:43:39 +0000 Subject: [PATCH] Fixes Issue 790 Tolerate malformed UIDL response. Thanks to @bengnc for thorough analysis in Issue 790. --- src/com/fsck/k9/mail/store/Pop3Store.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/com/fsck/k9/mail/store/Pop3Store.java b/src/com/fsck/k9/mail/store/Pop3Store.java index da271ee1f..2a677c75a 100644 --- a/src/com/fsck/k9/mail/store/Pop3Store.java +++ b/src/com/fsck/k9/mail/store/Pop3Store.java @@ -513,15 +513,18 @@ public class Pop3Store extends Store break; } String[] uidParts = response.split(" "); - Integer msgNum = Integer.valueOf(uidParts[0]); - String msgUid = uidParts[1]; - if (msgNum >= start && msgNum <= end) + if (uidParts.length >= 2) { - Pop3Message message = mMsgNumToMsgMap.get(msgNum); - if (message == null) + Integer msgNum = Integer.valueOf(uidParts[0]); + String msgUid = uidParts[1]; + if (msgNum >= start && msgNum <= end) { - message = new Pop3Message(msgUid, this); - indexMessage(msgNum, message); + Pop3Message message = mMsgNumToMsgMap.get(msgNum); + if (message == null) + { + message = new Pop3Message(msgUid, this); + indexMessage(msgNum, message); + } } } }