Re: imap_sasl_callback() protocol check is incomplete

Ken Hornstein <[email protected]> Mon, 30 Jun 2025 10:10:31 -0400
Newsgroups gmane.mail.nmh.devel
Message-ID <[email protected]>
>When function 'imap_sasl_callback' reads a response from the server, it
>appears that it intends to check that the first 2 characters are "+ ".
>
>Actually, the code checks this only in the case of a blank response,
>because the check is limited by testing if "len == 2".
>
>This patch replaces the whole multi-clause test with a call to
>has_prefix_len(), making the code both correct and more readable.

Hm.  I wrote that code and in the specific case of imaptest it's not
even built by default, but I am wondering what I was thinking.

I _think_ I did a bad cut & paste job from the code starting on line 607
(which is checking for an explicit blank response).  I agree your patch
is correct and I'll apply it later today.

--Ken