[PATCH 1/5] torture/ioctl: fix check_[zero/pattern]() for len=0
David Disseldorp
ddiss at samba.org
Mon Feb 9 04:09:31 MST 2015
Subtraction currently triggers an underflow.
Signed-off-by: David Disseldorp <ddiss at samba.org>
---
source4/torture/smb2/ioctl.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/source4/torture/smb2/ioctl.c b/source4/torture/smb2/ioctl.c
index 344ff0e..208a63f 100644
--- a/source4/torture/smb2/ioctl.c
+++ b/source4/torture/smb2/ioctl.c
@@ -164,6 +164,10 @@ static bool check_pattern(struct torture_context *torture,
struct smb2_read r;
NTSTATUS status;
+ if (len == 0) {
+ return true;
+ }
+
ZERO_STRUCT(r);
r.in.file.handle = h;
r.in.length = len;
@@ -194,6 +198,10 @@ static bool check_zero(struct torture_context *torture,
struct smb2_read r;
NTSTATUS status;
+ if (len == 0) {
+ return true;
+ }
+
ZERO_STRUCT(r);
r.in.file.handle = h;
r.in.length = len;
--
2.1.4
More information about the samba-technical
mailing list