smb2_server: fix smbd_smb2_request_verify_sizes() for SMB2_OP_WRITE
authorStefan Metzmacher <metze@samba.org>
Mon, 11 May 2020 16:18:24 +0000 (18:18 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 12 May 2020 19:53:43 +0000 (19:53 +0000)
commita6eee38ba2f89280676f0a32d26745afd95b551c
tree8bcbdea36a5a57597827680d7116b090138406e0
parent3ba7a89cea85d134eacf1e624e011fe6f66146fc
smb2_server: fix smbd_smb2_request_verify_sizes() for SMB2_OP_WRITE

Writes with a length of 0 are allowed.

The readfile related check we had before was not really useful
as min_dyn_len can only every be 0 or 1 (and for SMB2_OP_WRITE it's
always 1). So we checked
  if (unread_bytes > 0) {
     if (unread_bytes < 1) {
       return error;
     }
  }

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14361

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/smb2_server.c