Skip to content

Return code of curl_multi_add_handle is not handled properly #379

@bitscher

Description

@bitscher

Static analysis shows that return value of the function call to curl_multi_add_handle in function add_to_curlm is not handled properly.

mod_md/src/md_curl.c

Lines 448 to 459 in 2f7df2d

static void add_to_curlm(md_http_request_t *req, CURLM *curlm)
{
md_curl_internals_t *internals = req->internals;
assert(curlm);
assert(internals);
if (internals->curlm == NULL) {
internals->curlm = curlm;
}
assert(internals->curlm == curlm);
curl_multi_add_handle(curlm, internals->curl);
}

Return codes should probably be forwarded by add_to_curlm and handled in the calling-scope in function md_curl_multi_perform alongside other errors.

mod_md/src/md_curl.c

Lines 527 to 539 in 2f7df2d

if (APR_SUCCESS != (rv = internals_setup(req))) {
if (req->cb.on_status) req->cb.on_status(req, rv, req->cb.on_status_data);
md_log_perror(MD_LOG_MARK, MD_LOG_TRACE3, rv, p,
"multi_perform[%d reqs]: setup failed", requests->nelts);
APR_ARRAY_PUSH(http_spares, md_http_t*) = sub_http;
goto leave;
}
APR_ARRAY_PUSH(requests, md_http_request_t*) = req;
add_to_curlm(req, curlm);
md_log_perror(MD_LOG_MARK, MD_LOG_TRACE3, rv, p,
"multi_perform[%d reqs]: added request", requests->nelts);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions