Fix a potential stack overflow error
b/13906567 Change-Id: I21be980d4b4878ada0df6d3af706fee55afb4f2b
This commit is contained in:
parent
050327247b
commit
d58b490479
|
@ -275,6 +275,11 @@ class ImapConnection {
|
||||||
throws MessagingException, IOException {
|
throws MessagingException, IOException {
|
||||||
LogUtils.d(Logging.LOG_TAG, "sendCommand %s", (sensitive ? IMAP_REDACTED_LOG : command));
|
LogUtils.d(Logging.LOG_TAG, "sendCommand %s", (sensitive ? IMAP_REDACTED_LOG : command));
|
||||||
open();
|
open();
|
||||||
|
return sendCommandInternal(command, sensitive);
|
||||||
|
}
|
||||||
|
|
||||||
|
String sendCommandInternal(String command, boolean sensitive)
|
||||||
|
throws MessagingException, IOException {
|
||||||
String tag = Integer.toString(mNextCommandTag.incrementAndGet());
|
String tag = Integer.toString(mNextCommandTag.incrementAndGet());
|
||||||
String commandToSend = tag + " " + command;
|
String commandToSend = tag + " " + command;
|
||||||
mTransport.writeLine(commandToSend, sensitive ? IMAP_REDACTED_LOG : null);
|
mTransport.writeLine(commandToSend, sensitive ? IMAP_REDACTED_LOG : null);
|
||||||
|
@ -542,7 +547,7 @@ class ImapConnection {
|
||||||
|
|
||||||
private ImapResponse getOAuthResponse() throws IOException, MessagingException {
|
private ImapResponse getOAuthResponse() throws IOException, MessagingException {
|
||||||
ImapResponse response;
|
ImapResponse response;
|
||||||
sendCommand(getLoginPhrase(), true);
|
sendCommandInternal(getLoginPhrase(), true);
|
||||||
do {
|
do {
|
||||||
response = mParser.readResponse();
|
response = mParser.readResponse();
|
||||||
} while (!response.isTagged() && !response.isContinuationRequest());
|
} 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
|
// 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
|
// 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.
|
// reply with a CR/LF, and it will then return with a NO response.
|
||||||
sendCommand("", true);
|
sendCommandInternal("", true);
|
||||||
response = readResponse();
|
response = readResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue