Commit 715e0c3
fix(macOS 11): prevent UAF crash in WKURLSchemeHandler stop_task
macOS 11 WebKit bug: during WKWebView dealloc, stopAllTasksForPage calls
stop_task with already-freed task pointers. Any access (including the
implicit objc_release from objc2 reference types) causes SIGSEGV.
Fix:
- stop_task: use raw pointers (*mut AnyObject) instead of objc2 references
to skip automatic retain/release. Body is no-op since task is invalid.
- start_task response handler: explicit drop(webview) before drop(task) to
ensure correct deallocation order.1 parent 5bdda32 commit 715e0c3
1 file changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
289 | | - | |
| 289 | + | |
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
294 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
295 | 301 | | |
296 | 302 | | |
297 | 303 | | |
| |||
334 | 340 | | |
335 | 341 | | |
336 | 342 | | |
337 | | - | |
338 | | - | |
| 343 | + | |
| 344 | + | |
339 | 345 | | |
340 | | - | |
| 346 | + | |
341 | 347 | | |
0 commit comments