In case of htx_set_eom() failure, qcc_set_error() is used both for DATA
and trailers parsing, setting INTERNAL_ERROR as value. Both parsers
return a negative value to interrupt h3_rcv_buf() parsing loop. However,
this causes a crash as qcc_set_error() is called a second time on the
function epilogue.
Fix this by removing qcc_set_error() usage in both h3_data_to_htx() /
h3_trailers_to_htx(). They still return a negative value, which is now
properly handled in h3_rcv_buf() epilogue : INTERNAL_ERROR is set as
both h3c <err> and h3s <err> are unset.
This must be backported up to 3.0.
/* Ensure EOM is reported when an empty frame is handled. */
if (!htx_set_eom(htx)) {
TRACE_ERROR("cannot set EOM", H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
- qcc_set_error(qcs->qcc, H3_ERR_INTERNAL_ERROR, 1,
- muxc_tevt_type_internal_err);
len = -1;
goto out;
}
/* Ensure EOM is reported when an empty frame is handled. */
if (!htx_set_eom(htx)) {
TRACE_ERROR("cannot set EOM", H3_EV_RX_FRAME, qcs->qcc->conn, qcs);
- qcc_set_error(qcs->qcc, H3_ERR_INTERNAL_ERROR, 1,
- muxc_tevt_type_internal_err);
goto err;
}