Mirror von
https://github.com/tkuschel/bees.git
synchronisiert 2026-05-08 04:59:37 +02:00
fs: if search fails, return empty result set
Make sure the result set is empty before running the ioctl in case something tries to consume the result without checking the error status. Signed-off-by: Zygo Blaxell <bees@furryterror.org>
Dieser Commit ist enthalten in:
+2
-2
@@ -823,6 +823,8 @@ namespace crucible {
|
||||
|
||||
ioctl_ptr->buf_size = m_buf_size;
|
||||
|
||||
m_result.clear();
|
||||
|
||||
// Don't bother supporting V1. Kernels that old have other problems.
|
||||
int rv = ioctl(fd, BTRFS_IOC_TREE_SEARCH_V2, ioctl_ptr);
|
||||
if (rv != 0) {
|
||||
@@ -831,8 +833,6 @@ namespace crucible {
|
||||
|
||||
static_cast<btrfs_ioctl_search_key&>(*this) = ioctl_ptr->key;
|
||||
|
||||
m_result.clear();
|
||||
|
||||
size_t offset = pointer_distance(ioctl_ptr->buf, ioctl_ptr);
|
||||
for (decltype(nr_items) i = 0; i < nr_items; ++i) {
|
||||
BtrfsIoctlSearchHeader item;
|
||||
|
||||
In neuem Issue referenzieren
Einen Benutzer sperren