diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-10-31 16:47:55 +0000 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-11-02 08:49:01 +0000 |
commit | 115ee28263c28c78a34ce4e40a9e4be8361deee6 (patch) | |
tree | 389555fe6423de2cd5f74f45e7c1a73b53cd8812 /ssl | |
parent | daf26c2d7a4d29ec1040fc0d5d4215cfc2dcf4a7 (diff) |
QUIC SSTREAM: Fix bug in ossl_quic_sstream_is_totally_acked
ossl_quic_sstream_is_totally_acked would return 0
if no data had been appended to the stream yet.
Fixed and added tests.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22580)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_sstream.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ssl/quic/quic_sstream.c b/ssl/quic/quic_sstream.c index a5ae234a8e..1f0b5497fc 100644 --- a/ssl/quic/quic_sstream.c +++ b/ssl/quic/quic_sstream.c @@ -379,8 +379,13 @@ int ossl_quic_sstream_is_totally_acked(QUIC_SSTREAM *qss) UINT_RANGE r; uint64_t cur_size; - if ((qss->have_final_size && !qss->acked_final_size) - || ossl_list_uint_set_num(&qss->acked_set) != 1) + if (qss->have_final_size && !qss->acked_final_size) + return 0; + + if (ossl_quic_sstream_get_cur_size(qss) == 0) + return 1; + + if (ossl_list_uint_set_num(&qss->acked_set) != 1) return 0; r = ossl_list_uint_set_head(&qss->acked_set)->range; |