mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-06-11 01:25:53 -04:00
Close session before freeing notification
With the new CookieStore, the session must be freed before the notification is. This is how it works in CDP, but in fetch, we were pretty lazy about it. This caused the notification to be freed first, and then the cookiestore to try to unregister: UAF.
This commit is contained in:
@@ -67,6 +67,7 @@ pub fn fetch(app: *App, browser: *Browser, url: [:0]const u8, opts: FetchOpts) !
|
||||
defer notification.deinit();
|
||||
|
||||
var session = try browser.newSession(notification);
|
||||
defer browser.closeSession();
|
||||
|
||||
if (app.config.cookieFile()) |cookie_path| {
|
||||
cookies.loadFromFile(session, cookie_path);
|
||||
|
||||
Reference in New Issue
Block a user