Skip incorrectly formatted/parsed LSUB/LIST replies

Example: * LIST (\HasChildren) "." [Folder]
"[Folder]" will be parsed as list containing the element "Folder".
This commit is contained in:
cketti 2013-08-20 18:39:20 +02:00
parent 7a04c19798
commit f11f0fcc9b
1 changed files with 6 additions and 0 deletions

View File

@ -566,6 +566,12 @@ public class ImapStore extends Store {
if (ImapResponseParser.equalsIgnoreCase(response.get(0), commandResponse)) {
boolean includeFolder = true;
if (response.size() > 4 || !(response.getObject(3) instanceof String)) {
Log.w(K9.LOG_TAG, "Skipping incorrectly parsed " + commandResponse +
" reply: " + response);
continue;
}
String decodedFolderName;
try {
decodedFolderName = decodeFolderName(response.getString(3));