From 77f335042b01fcef0bbe09e1070528c00b523063 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 18 Nov 2009 08:11:46 +0100 Subject: s4:ntvfs_generic: check for valid SMB2_LOCK flags metze --- source4/ntvfs/ntvfs_generic.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/ntvfs_generic.c b/source4/ntvfs/ntvfs_generic.c index 6e2e075f1e..1d81acfd81 100644 --- a/source4/ntvfs/ntvfs_generic.c +++ b/source4/ntvfs/ntvfs_generic.c @@ -1113,6 +1113,14 @@ NTSTATUS ntvfs_map_lock(struct ntvfs_module_context *ntvfs, isunlock = false; } for (i=0;ismb2.in.lock_count;i++) { + if (lck->smb2.in.locks[i].flags == SMB2_LOCK_FLAG_NONE) { + return NT_STATUS_INVALID_PARAMETER; + } + + if (lck->smb2.in.locks[i].flags & ~SMB2_LOCK_FLAG_ALL_MASK) { + return NT_STATUS_INVALID_PARAMETER; + } + if (isunlock && (lck->smb2.in.locks[i].flags & (SMB2_LOCK_FLAG_SHARED|SMB2_LOCK_FLAG_EXCLUSIVE))) { -- cgit