mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
lib: Fix a use-after-free in "net vfs getntacl"
Don't hang "sd" off "fsp", which is free'ed before printing Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Jan 12 16:41:07 UTC 2023 on sn-devel-184
This commit is contained in:
parent
d278fe4a84
commit
425aaf6f7e
@ -276,7 +276,7 @@ static int net_vfs_get_ntacl(struct net_context *net,
|
||||
|
||||
status = SMB_VFS_FGET_NT_ACL(fsp,
|
||||
SECINFO_OWNER|SECINFO_GROUP|SECINFO_DACL,
|
||||
fsp,
|
||||
talloc_tos(),
|
||||
&sd);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
DBG_ERR("SMB_VFS_FGET_NT_ACL [%s] failed: %s\n",
|
||||
@ -296,6 +296,8 @@ static int net_vfs_get_ntacl(struct net_context *net,
|
||||
|
||||
rc = 0;
|
||||
done:
|
||||
TALLOC_FREE(sd);
|
||||
|
||||
if (fsp != NULL) {
|
||||
status = close_file_free(NULL, &fsp, NORMAL_CLOSE);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user