]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC TSERVER: Handle return value correctly (coverity)
authorHugo Landau <hlandau@openssl.org>
Thu, 27 Jul 2023 15:23:20 +0000 (16:23 +0100)
committerHugo Landau <hlandau@openssl.org>
Thu, 10 Aug 2023 17:19:51 +0000 (18:19 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21565)

ssl/quic/quic_tserver.c

index b92b1de8da043fbadf883cc39b48fbb75dd84101..efdc6c4b8b84008ffc6a7e24a7b27914df751b5b 100644 (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 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);