Explorar o código

NTFileSystemAdapter: Return STATUS_END_OF_FILE when applicable

Tal Aloni %!s(int64=5) %!d(string=hai) anos
pai
achega
431a62ce6f
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  1. 5 0
      SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs

+ 5 - 0
SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs

@@ -378,6 +378,11 @@ namespace SMBLibrary
                 return NTStatus.STATUS_ACCESS_DENIED;
             }
 
+            if (offset >= stream.Length)
+            {
+                return NTStatus.STATUS_END_OF_FILE;
+            }
+
             int bytesRead;
             try
             {