summaryrefslogtreecommitdiffstats
path: root/ssl/quic/quic_tserver.c
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-07-27 16:23:20 +0100
committerHugo Landau <hlandau@openssl.org>2023-08-10 18:19:51 +0100
commitf540b6b4f6608fa5edfa2ec77fce6d3c92bb9a1f (patch)
tree83c1710cf210b756f4b16ad05adc94f860136a1e /ssl/quic/quic_tserver.c
parent4669a3d79b59d037ccb5b4a30bc522ebe55d3eec (diff)
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)
Diffstat (limited to 'ssl/quic/quic_tserver.c')
-rw-r--r--ssl/quic/quic_tserver.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ssl/quic/quic_tserver.c b/ssl/quic/quic_tserver.c
index b92b1de8da..efdc6c4b8b 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);