cyrusimap / cyrus-sasl

Other
134 stars 151 forks source link

Bug 1147659 - cyrus-sasl client library (client.c) is not thread safe #846

Closed rcritten closed 4 months ago

rcritten commented 4 months ago

Description: client_dispose (lib/client.c) which closes a connection of a sasl client frees mech_list if the head of the list differs from the head of the global cmechlist->mech_list. But there was a possibility that the list appears in the middle of the global mech list. By freeing the mech, it crashed a multi-threaded sasl client.

This patch checks each mech if it is in the global mech list or not. Only if it is not, the mech is freed.

hyc commented 4 months ago

Thanks @rcritten but it looks like we crossed in flight. Issue #715 is already fixed.