Skip to content

7.81 Segmentation Fault #8282

@updatede

Description

@updatede

May application work good with 7.80, after upgrade from 7.80 to 7.81 I got segmentation fault.
After some trace, I found it's becuase the position of Curl_update_timer(multi) in curl_multi_add_handle changed.
When I make connection, I call curl_multi_add_handle, in it Curl_update_timer call my time_cb where I call curl_multi_socket_action, it call multi_socket,multi_runsingle,Curl_pretransfer, I use manually added dns resolve pair, so it call Curl_loadhostpairs, in Curl_loadhostpairs, it use data->dns.hostcache which is zero, so segmentation fault.
For 7.80, data->dns.hostcache is assigned before Curl_update_timer(multi) in curl_multi_add_handle, but for 7.81, data->dns.hostcache is assigned after Curl_update_timer(multi) because it's position changed. I move Curl_update_timer(multi) to the end of curl_multi_add_handle like 7.80, everthing is ok now.
Please put ``Curl_update_timer(multi)` in appropriate place in future version.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions