mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-08-03 06:21:49 +02:00
FileTimeHelper.ReadNullableFileTime: throw InvalidDataException if FILETIME is negative
This commit is contained in:
parent
3ed2bbcd1c
commit
bef9bd6e69
1 changed files with 5 additions and 1 deletions
|
@ -52,10 +52,14 @@ namespace SMBLibrary
|
|||
{
|
||||
return DateTime.FromFileTimeUtc(span);
|
||||
}
|
||||
else
|
||||
else if (span == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new System.IO.InvalidDataException("FILETIME cannot be negative");
|
||||
}
|
||||
}
|
||||
|
||||
public static DateTime? ReadNullableFileTime(byte[] buffer, ref int offset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue