summaryrefslogtreecommitdiff
path: root/source4/ntvfs
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-11-18 08:11:46 +0100
committerStefan Metzmacher <metze@samba.org>2009-11-18 08:24:13 +0100
commit77f335042b01fcef0bbe09e1070528c00b523063 (patch)
treed9fe1c47b6936753cd72175c6f4e98d73c268253 /source4/ntvfs
parent575967a5cf2f512ae25e5376bb49b133c6d5fc2d (diff)
downloadsamba-77f335042b01fcef0bbe09e1070528c00b523063.tar.gz
samba-77f335042b01fcef0bbe09e1070528c00b523063.tar.bz2
samba-77f335042b01fcef0bbe09e1070528c00b523063.zip
s4:ntvfs_generic: check for valid SMB2_LOCK flags
metze
Diffstat (limited to 'source4/ntvfs')
-rw-r--r--source4/ntvfs/ntvfs_generic.c8
1 files changed, 8 insertions, 0 deletions
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;i<lck->smb2.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))) {