Skip to content

Commit

Permalink
widget/Registry: free the TranslateResponse, fixing more UAF bugs
Browse files Browse the repository at this point in the history
See commit acda233
  • Loading branch information
MaxKellermann committed Sep 2, 2024
1 parent 5c8ce9d commit 2dbae8e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/widget/Registry.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ WidgetRegistryLookup::OnTranslateResponse(UniquePoolPtr<TranslateResponse> _resp
assert(!response.views.empty());

if (response.status != HttpStatus{}) {
_response.reset();
callback(nullptr);
return;
}
Expand All @@ -90,6 +91,8 @@ WidgetRegistryLookup::OnTranslateResponse(UniquePoolPtr<TranslateResponse> _resp
cls->dump_headers = response.dump_headers;
cls->views = Clone(widget_pool, response.views);

_response.reset();

cache.Put(name, *cls);

callback(cls);
Expand Down

0 comments on commit 2dbae8e

Please sign in to comment.