GNOME Bugzilla – Bug 778258
RequestAsyncData use after free
Last modified: 2017-02-08 19:02:38 UTC
libyelp/yelp-view.c is requesting data form the YelpDocument. The document_callback is being executed with an RequestAsyncData user_data after that structure has been freed. This seems to be causing crashes when editing a file that is being viewed in Yelp.
I did some bisecting and this seems to have been broken ever since the WebKit2 port.
Created attachment 345163 [details] [review] document: add destroy notify to page callback This ensures that we only free the async data struct when the document is guaranteed to be done calling our callback. Without this, we risk potentially accessing the async request data after we have freed it when a mallard document reloads.
The patch won't fully fix crashes, (as bug 778263 is also related), but it does solve the issue with async request data being freed prematurely.
Review of attachment 345163 [details] [review]: Looks good, thanks!
Attachment 345163 [details] pushed as 7d8ee5a - document: add destroy notify to page callback