From a6c06024a836425ad155d9380a3e62ab069d2e1c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 16 Sep 2009 03:20:49 +0200 Subject: [PATCH] s3: Fix reading beyond the end of a named stream in xattr_streams This was found thanks to a test by Sivani from Microsoft against Samba at the SDC plugfest (cherry picked from commit 444a05c28df693a745809fef73ae583a78be7c8f) Fix bug #6731. (cherry picked from commit ff9355149c9af7ca0e31b36690b270a03cb787fc) --- source3/modules/vfs_streams_xattr.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index 3d5478d7a25..c5a7c697da2 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -867,8 +867,7 @@ static ssize_t streams_xattr_pread(vfs_handle_struct *handle, /* Attempt to read past EOF. */ if (length <= offset) { - errno = EINVAL; - return -1; + return 0; } overlap = (offset + n) > length ? (length - offset) : n; -- 2.11.4.GIT