aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Robert Widmann <devteam.codafi@gmail.com>2016-01-19 00:43:11 -0500
committerGravatar Robert Widmann <devteam.codafi@gmail.com>2016-01-19 00:43:11 -0500
commit84451cca41b0310a980cbedb102d2cfb645a86a7 (patch)
treef03d626f10a03c322d0fd7b3865fcc6aadadf2e1 /src
parent63e1f0471769d8a72edeafbd4e65b9d0c2763e9e (diff)
Make a null OAUTH token a stream error
Diffstat (limited to 'src')
-rw-r--r--src/core/smtp/MCSMTPSession.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/core/smtp/MCSMTPSession.cpp b/src/core/smtp/MCSMTPSession.cpp
index 0c2016fd..5c04a438 100644
--- a/src/core/smtp/MCSMTPSession.cpp
+++ b/src/core/smtp/MCSMTPSession.cpp
@@ -529,7 +529,13 @@ void SMTPSession::login(ErrorCode * pError)
if (utf8Username == NULL) {
utf8Username = "";
}
- r = mailsmtp_oauth2_authenticate(mSmtp, utf8Username, MCUTF8(mOAuth2Token));
+
+ if (mOAuth2Token == NULL) {
+ r = MAILSMTP_ERROR_STREAM;
+ }
+ else {
+ r = mailsmtp_oauth2_authenticate(mSmtp, utf8Username, MCUTF8(mOAuth2Token));
+ }
break;
}
@@ -538,7 +544,12 @@ void SMTPSession::login(ErrorCode * pError)
if (utf8Username == NULL) {
utf8Username = "";
}
- r = mailsmtp_oauth2_outlook_authenticate(mSmtp, utf8Username, MCUTF8(mOAuth2Token));
+
+ if (mOAuth2Token == NULL) {
+ r = MAILSMTP_ERROR_STREAM;
+ } else {
+ r = mailsmtp_oauth2_outlook_authenticate(mSmtp, utf8Username, MCUTF8(mOAuth2Token));
+ }
break;
}
}