Skip to content

Commit

Permalink
#375 fix use after free
Browse files Browse the repository at this point in the history
  • Loading branch information
koekeishiya committed Jan 20, 2020
1 parent 8cc6088 commit 2c3f854
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
### Changed
- Fix use after free.. [#375](https://github.com/koekeishiya/yabai/issues/375)

## [2.2.1] - 2020-01-19
### Changed
Expand Down
8 changes: 7 additions & 1 deletion src/space_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,9 +866,15 @@ void space_manager_handle_display_add(struct space_manager *sm, uint32_t did)
if (!uuid) continue;

for (int j = 0; j < list_count; ++j) {
if (CFEqual(uuid_list[j], uuid)) {
CFStringRef view_uuid = uuid_list[j];
if (!view_uuid) continue;

if (CFEqual(view_uuid, uuid)) {
struct view *view = view_list[j];

uuid_list[j] = NULL;
view_list[j] = NULL;

table_remove(&sm->view, &view->sid);
CFRelease(view->suuid);

Expand Down

0 comments on commit 2c3f854

Please sign in to comment.