imap: add a check for Curl_meta_get()

It should not return NULL, but if it does we need to bail out. Like we
do elsewhere.a

Found by CodeSonar.
Closes #20510
This commit is contained in:
Daniel Stenberg 2026-02-03 17:11:04 +01:00
parent 2d4efbb9b3
commit fdca2e0fd3
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1224,6 +1224,9 @@ static CURLcode imap_state_listsearch_resp(struct Curl_easy *data,
size_t len = imapc->pp.nfinal;
struct IMAP *imap = Curl_meta_get(data, CURL_META_IMAP_EASY);
DEBUGASSERT(imap);
if(!imap)
return CURLE_FAILED_INIT;
(void)instate;
if(imapcode == '*' && is_custom_fetch_listing(imap)) {