1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

smbd: Slightly simplify smbd_dirptr_lanman2_entry()'s overflow logic

No caller does anything with the smb_fname upon overflow, so we might
as well do an early return.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2023-06-09 14:44:58 +02:00 committed by Jeremy Allison
parent ae4d8ddbee
commit abcc7e69ce

View File

@ -2003,9 +2003,11 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
*file_id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
}
if (!NT_STATUS_IS_OK(status) &&
!NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES))
{
if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
dptr_SeekDir(dirptr, prev_dirpos);
}
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(smb_fname);
TALLOC_FREE(fname);
return status;
@ -2035,11 +2037,6 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx,
}
TALLOC_FREE(fname);
if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) {
dptr_SeekDir(dirptr, prev_dirpos);
return status;
}
*_last_entry_off = last_entry_off;
return NT_STATUS_OK;
}