in FixAntenna/NetCore/Message/FixTypes.cs [1139:1188]
public static bool IsInvalidMonthYear44(byte[] buffer, int offset, int count)
{
try
{
if (count != 6 && count != 8)
{
return true;
}
var year = ParseNumberPart(buffer, offset, offset + 4);
if (year < 1582)
{
return true;
}
var month = ParseNumberPart(buffer, offset + 4, offset + 6) - 1;
if (month < 0 || month > 11)
{
return true;
}
if (count == 8)
{
if (buffer[offset + 6] == (byte)'w')
{
var week = buffer[offset + 7] - '0';
if (week < 1 || week > 5)
{
return true;
}
}
else
{
var date = ParseNumberPart(buffer, offset + 6, offset + 8);
if (date < 1 || date > (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)
? LeapMonthLength[month]
: MonthLength[month]))
{
return true;
}
}
}
}
catch (Exception)
{
return true;
}
return false;
}