jstedfast / EmailValidation

A simple (but correct) .NET class for validating email addresses

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validation fails for an email address with 64 chars before @

yl1232 opened this issue · comments

Hi,
Email address validation fails I try to validate an email address with 64 letters before '@'.
Email address for example: "testaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa@outlook.com"
As far as I know, the rfc653x standard allows an email address to contain up to 64 letters before '@' so in this case the validation should succeed and return 'True'.
Could you please look into it?

Thanks,
Yaniv

seems the reason is this line in code
if (index + 1 >= email.Length || index > 64 || email[index++] != '@')
OR condition is evaluated without order, so index is being incremented, [index++], before checking size index > 64

No, this was fixed in September, I just never made a 1.0.7 release: see commit 819f5c8

You guys don't need net45, do you? Is it ok if I bump the minimum supported .NET Framework to at least 4.5.2?

yes, we are using .NET 5

Just released 1.0.7 with the fix for this.