]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: Protect against an empty stream prefix
authorVolker Lendecke <vl@samba.org>
Thu, 4 Sep 2025 14:48:07 +0000 (16:48 +0200)
committerRalph Boehme <slow@samba.org>
Tue, 21 Oct 2025 17:33:29 +0000 (17:33 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_streams_xattr.c

index dd5e6b8164d0bb4841cf2e7a910caae3be1556c0..7ea42220207cec2a28bf02282e73ef350ac1217c 100644 (file)
@@ -1107,6 +1107,12 @@ static int streams_xattr_connect(vfs_handle_struct *handle,
        config->prefix_len = strlen(config->prefix);
        DEBUG(10, ("streams_xattr using stream prefix: %s\n", config->prefix));
 
+       if (config->prefix_len == 0) {
+               DBG_WARNING("Empty prefix not valid\n");
+               errno = EINVAL;
+               return -1;
+       }
+
        config->store_stream_type = lp_parm_bool(SNUM(handle->conn),
                                                 "streams_xattr",
                                                 "store_stream_type",