Commit 49f41654 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

preparser: Fix potential use after free

If the art fetcher completes before ReqHold gets called, we will end up
releasing the request before holding it for the art fetcher, causing a
use after free when the task gets released by the background worker
invokes TerminateTask
parent 1e4ad46b
......@@ -203,13 +203,14 @@ static void PreparserCloseInput( void* preparser_, void* task_ )
if( preparser->fetcher && (req->options & META_REQUEST_OPTION_FETCH_ANY) )
{
task->preparse_status = status;
ReqHold(task->req);
if (!input_fetcher_Push(preparser->fetcher, item,
req->options & META_REQUEST_OPTION_FETCH_ANY,
&input_fetcher_callbacks, task))
{
ReqHold(task->req);
return;
}
ReqRelease(task->req);
}
free(task);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment