io: fix null pointer deref in win32 update_iterator_data
This commit is contained in:
@@ -159,17 +159,18 @@ static void update_iterator_data(struct b_directory_iterator *it)
|
||||
}
|
||||
|
||||
struct iteration_state *state = get_iteration_state(it->_z);
|
||||
it->filename = state->data.cFileName;
|
||||
if (state) {
|
||||
it->filename = state->data.cFileName;
|
||||
|
||||
struct b_path *filename = b_path_create_from_cstr(it->filename);
|
||||
struct b_path *filename = b_path_create_from_cstr(it->filename);
|
||||
|
||||
const struct b_path *parts[] = {
|
||||
state->search_path,
|
||||
filename,
|
||||
};
|
||||
const struct b_path *parts[] = {
|
||||
state->search_path,
|
||||
filename,
|
||||
};
|
||||
|
||||
it->filepath
|
||||
= b_path_join(parts, sizeof parts / sizeof parts[0]);
|
||||
it->filepath = b_path_join(parts, sizeof parts / sizeof parts[0]);
|
||||
}
|
||||
}
|
||||
|
||||
static bool move_into_directory(struct b_directory_iterator *it, const char *dir_name)
|
||||
|
||||
Reference in New Issue
Block a user