Browse Source

SMBServer: SMB1: Fixed unhandled NullReferenceException when an Invalid FID was specified for a Read / ReadAndX request

Tal Aloni 7 years ago
parent
commit
4ade8c4aa9
1 changed files with 2 additions and 2 deletions
  1. 2 2
      SMBLibrary/Server/SMB1/ReadWriteResponseHelper.cs

+ 2 - 2
SMBLibrary/Server/SMB1/ReadWriteResponseHelper.cs

@@ -25,7 +25,7 @@ namespace SMBLibrary.Server.SMB1
             {
                 state.LogToServer(Severity.Verbose, "Read failed. Invalid FID.");
                 header.Status = NTStatus.STATUS_INVALID_HANDLE;
-                return null;
+                return new ErrorResponse(request.CommandName);
             }
 
             if (share is FileSystemShare)
@@ -60,7 +60,7 @@ namespace SMBLibrary.Server.SMB1
             {
                 state.LogToServer(Severity.Verbose, "Read failed. Invalid FID.");
                 header.Status = NTStatus.STATUS_INVALID_HANDLE;
-                return null;
+                return new ErrorResponse(request.CommandName);
             }
 
             if (share is FileSystemShare)