forked from sakura-editor/sakura
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1046,11 +1046,12 @@ BOOL IsMailAddress( const wchar_t* pszBuf, int nBufLen, int* pnAddressLength ) | |
// RFC5321による mailbox の最大文字数 | ||
constexpr ptrdiff_t MAX_MAILBOX = 255; //255オクテット | ||
|
||
// 論理的なメールアドレス長の下限文字数 | ||
// 1(@手前) + 1(@) + 3(ドメイン最小文字数) + 1(.) + 3(TLD) = 9 | ||
constexpr ptrdiff_t MIN_MAILBOX = 9; | ||
// mailboxの最小文字数(これより短いと構成要素を含めなくなる) | ||
// 例) [email protected] | ||
// 1(@手前) + 1(@) + 1(ドメイン) + 1(.) + 2(TLD/ccTLD) = 6 | ||
constexpr ptrdiff_t MIN_MAILBOX = 6; | ||
|
||
// 想定しないパラメータは前半チェックの前に弾く | ||
// 想定しないパラメータは前半チェックの前に弾く | ||
if (pszBuf == nullptr || nBufLen < MIN_MAILBOX) return FALSE; | ||
|
||
// メールアドレスには必ず@が含まれる | ||
|