From: Hugo Landau Date: Thu, 27 Jul 2023 15:23:20 +0000 (+0100) Subject: QUIC TSERVER: Handle return value correctly (coverity) X-Git-Tag: openssl-3.2.0-alpha1~230 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f540b6b4f6608fa5edfa2ec77fce6d3c92bb9a1f;p=thirdparty%2Fopenssl.git QUIC TSERVER: Handle return value correctly (coverity) Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/21565) --- diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c index b92b1de8da0..efdc6c4b8b8 100644 --- a/ssl/quic/quic_tserver.c +++ b/ssl/quic/quic_tserver.c @@ -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 we have a FIN awaiting retirement and no data before it... */ /* Let RSTREAM know we've consumed this FIN. */ - ossl_quic_rstream_read(qs->rstream, buf, sizeof(buf), - &bytes_read, &is_fin); /* best effort */ + if (!ossl_quic_rstream_read(qs->rstream, buf, sizeof(buf), + &bytes_read, &is_fin)) { + bytes_read = 0; + is_fin = 0; + } + assert(is_fin && bytes_read == 0); assert(qs->recv_state == QUIC_RSTREAM_STATE_DATA_RECVD);