]> git.ipfire.org Git - thirdparty/curl.git/commit
multi: call protocol handler done() if PROTOCONNECT or later
authorDaniel Stenberg <daniel@haxx.se>
Wed, 12 Mar 2025 10:22:49 +0000 (11:22 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 12 Mar 2025 22:16:46 +0000 (23:16 +0100)
commit0bb8465b1e529f4ac1f764baa56117ea1fd73fe4
treefe1f4517550c3358ec3fe453d6f7986923ffb4c1
parent886569e2db200c31073895a2626d20e0712e5207
multi: call protocol handler done() if PROTOCONNECT or later

The protocol handlers' done() function would previous get called
unconditionally in multi_done(), no matter how far the easy handle's
state machine has transitioned.

This caused problems in IMAP which in imap_connect() initializes things
that the imap_done() function assumes has occured. I think that seems
like a correct assumption and we should rather make sure that the done()
function is only called if we have reached the PROTOCONNECT state.

This problem was found using OSS-Fuzz.

Assisted-by: Catena cyber
Closes #16681
lib/multi.c