am d58b4904: Fix a potential stack overflow error

* commit 'd58b490479bbde719d3e8626382c04829be6bbca':
  Fix a potential stack overflow error
This commit is contained in:
Martin Hibdon 2014-04-08 22:01:12 +00:00 committed by Android Git Automerger
commit 0680ba5e25
1 changed files with 7 additions and 2 deletions

View File

@ -275,6 +275,11 @@ class ImapConnection {
throws MessagingException, IOException {
LogUtils.d(Logging.LOG_TAG, "sendCommand %s", (sensitive ? IMAP_REDACTED_LOG : command));
open();
return sendCommandInternal(command, sensitive);
}
String sendCommandInternal(String command, boolean sensitive)
throws MessagingException, IOException {
String tag = Integer.toString(mNextCommandTag.incrementAndGet());
String commandToSend = tag + " " + command;
mTransport.writeLine(commandToSend, sensitive ? IMAP_REDACTED_LOG : null);
@ -542,7 +547,7 @@ class ImapConnection {
private ImapResponse getOAuthResponse() throws IOException, MessagingException {
ImapResponse response;
sendCommand(getLoginPhrase(), true);
sendCommandInternal(getLoginPhrase(), true);
do {
response = mParser.readResponse();
} while (!response.isTagged() && !response.isContinuationRequest());
@ -553,7 +558,7 @@ class ImapConnection {
// Currently, the only type of authentication we support is OAuth. The only case where
// it will send a continuation request is when we fail to authenticate. We need to
// reply with a CR/LF, and it will then return with a NO response.
sendCommand("", true);
sendCommandInternal("", true);
response = readResponse();
}