The branch, master has been updated
       via  3f82b8530a2 vfs_streams_xattr: Fix CID 1667321 REVERSE_INULL
       via  8d8a63e3f2a vfs_streams_xattr: Fix CID 1667323 Resource Leak
      from  f7812173e40 lib:ldb:tests: Fix memory leaks in 
ldb_lmdb_free_list_test

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 3f82b8530a295feeba3940fbab8ac218debdd1e6
Author: Shwetha K Acharya <[email protected]>
Date:   Wed Oct 29 16:42:47 2025 +0530

    vfs_streams_xattr: Fix CID 1667321 REVERSE_INULL
    
    Remove NULL check for fsp. A NULL fsp is a fatal error
    that should never occur in this context.
    
    Signed-off-by: Shwetha K Acharya <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    Reviewed-by: Anoop C S <[email protected]>
    
    Autobuild-User(master): Anoop C S <[email protected]>
    Autobuild-Date(master): Wed Oct 29 14:43:28 UTC 2025 on atb-devel-224

commit 8d8a63e3f2ad467c692ac63ece6feb3bdfe0d8ab
Author: Shwetha K Acharya <[email protected]>
Date:   Tue Oct 28 11:36:04 2025 +0530

    vfs_streams_xattr: Fix CID 1667323 Resource Leak
    
    val was not freed on early return paths; addressed it using
    done block.
    
    Signed-off-by: Shwetha K Acharya <[email protected]>
    Reviewed-by: Volker Lendecke <[email protected]>
    Reviewed-by: Anoop C S <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/modules/vfs_streams_xattr.c | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_streams_xattr.c 
b/source3/modules/vfs_streams_xattr.c
index 740d23a1952..f892bc45c66 100644
--- a/source3/modules/vfs_streams_xattr.c
+++ b/source3/modules/vfs_streams_xattr.c
@@ -419,9 +419,6 @@ static int streams_xattr_get_ea_value_fsp(
        ssize_t sizeret;
        bool refuse;
 
-       if (fsp == NULL) {
-               return EINVAL;
-       }
        refuse = refuse_symlink_fsp(fsp);
        if (refuse) {
                return EACCES;
@@ -1653,7 +1650,8 @@ static ssize_t streams_xattr_pread(vfs_handle_struct 
*handle,
 
        if (length < 1) {
                errno = EINVAL;
-               return -1;
+               ret = -1;
+               goto done;
        }
 
        length -= 1;
@@ -1663,14 +1661,17 @@ static ssize_t streams_xattr_pread(vfs_handle_struct 
*handle,
 
        /* Attempt to read past EOF. */
         if (length <= (size_t)offset) { /* offset>=0, see above */
-                return 0;
+                ret = 0;
+                goto done;
         }
 
         overlap = (offset + n) > length ? (length - offset) : n;
        memcpy(data, val + offset, overlap);
+       ret = overlap;
 
+done:
        TALLOC_FREE(val);
-       return overlap;
+       return ret;
 }
 
 struct streams_xattr_pread_state {


-- 
Samba Shared Repository

Reply via email to