QUIC TSERVER: Handle return value correctly (coverity)

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21565)
This commit is contained in:
Hugo Landau 2023-07-27 16:23:20 +01:00
parent 4669a3d79b
commit f540b6b4f6

View File

@ -308,8 +308,12 @@ int ossl_quic_tserver_has_read_ended(QUIC_TSERVER *srv, uint64_t stream_id)
if (is_fin && bytes_read == 0) { if (is_fin && bytes_read == 0) {
/* If we have a FIN awaiting retirement and no data before it... */ /* If we have a FIN awaiting retirement and no data before it... */
/* Let RSTREAM know we've consumed this FIN. */ /* Let RSTREAM know we've consumed this FIN. */
ossl_quic_rstream_read(qs->rstream, buf, sizeof(buf), if (!ossl_quic_rstream_read(qs->rstream, buf, sizeof(buf),
&bytes_read, &is_fin); /* best effort */ &bytes_read, &is_fin)) {
bytes_read = 0;
is_fin = 0;
}
assert(is_fin && bytes_read == 0); assert(is_fin && bytes_read == 0);
assert(qs->recv_state == QUIC_RSTREAM_STATE_DATA_RECVD); assert(qs->recv_state == QUIC_RSTREAM_STATE_DATA_RECVD);