--- source3/smbd/reply.org.c 2020-07-19 12:08:44.0 +0100 +++ source3/smbd/reply.c 2020-07-19 12:08:44.0 +0100 @@ -4227,7 +4227,7 @@ /* * However the requested READ size IS affected by max_send. Insanity.... JRA. */ - maxtoread = req->xconn->smb1.sessions.max_send - (smb_size + 5*2 + 3); + maxtoread = req->xconn->smb1.sessions.max_send - (MIN_SMB_SIZE + 5*2 + 3); if (numtoread > maxtoread) { DBG_WARNING("requested read size (%zu) is greater than " @@ -4323,7 +4323,7 @@ /* * The requested read size cannot be greater than max_send. JRA. */ - maxtoread = xconn->smb1.sessions.max_send - (smb_size + 5*2 + 3); + maxtoread = xconn->smb1.sessions.max_send - (MIN_SMB_SIZE + 5*2 + 3); if (numtoread > maxtoread) { DEBUG(0,("reply_read: requested read size (%u) is greater than maximum allowed (%u/%u). \