Bug 750012 - Fix assertion error in nsIMAPGenericParser::CreateParenGroup(). r=dbienvenu
authorDavid Lechner <gismho@gmail.com>
Mon, 18 Jun 2012 11:25:20 -0500
changeset 10477 3cc2a51baba8892b77b83b344c3c8a48f1d28567
parent 10476 9d0f0dd107b1ed4448f070de1049932ca3efc82b
child 10478 7631dde8734bd28ef9454d259faa6516c138426f
push id7925
push userryanvm@gmail.com
push dateTue, 19 Jun 2012 22:23:46 +0000
treeherdercomm-central@2b69382950af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdbienvenu
bugs750012
Bug 750012 - Fix assertion error in nsIMAPGenericParser::CreateParenGroup(). r=dbienvenu
mailnews/imap/src/nsImapServerResponseParser.cpp
--- a/mailnews/imap/src/nsImapServerResponseParser.cpp
+++ b/mailnews/imap/src/nsImapServerResponseParser.cpp
@@ -1306,20 +1306,26 @@ void nsImapServerResponseParser::msg_fet
         if (!fServerConnection.GetCurrentUrl())
           return;
         fServerConnection.GetCurrentUrl()->GetImapAction(&imapAction);
         nsCAutoString userDefinedFetchAttribute;
         fServerConnection.GetCurrentUrl()->GetCustomAttributeToFetch(userDefinedFetchAttribute);
         if (imapAction == nsIImapUrl::nsImapUserDefinedFetchAttribute && !strcmp(userDefinedFetchAttribute.get(), fNextToken))
         {
           AdvanceToNextToken();
-          char *fetchResult = CreateParenGroup();
-          // look through the tokens until we find the closing ')'
-          // we can have a result like the following:
-          // ((A B) (C D) (E F))
+          char *fetchResult;
+          if (fNextToken[0] == '(') 
+            // look through the tokens until we find the closing ')'
+            // we can have a result like the following:
+            // ((A B) (C D) (E F))
+            fetchResult = CreateParenGroup();
+          else {
+            fetchResult = CreateAstring();
+            AdvanceToNextToken();
+          }          
           fServerConnection.GetCurrentUrl()->SetCustomAttributeResult(nsDependentCString(fetchResult));
           PR_Free(fetchResult);
         }
         else
           SetSyntaxError(true);
       }
       
         }