]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix 32-bit Windows issues related to QUIC_STREAM
authorRichard Levitte <levitte@openssl.org>
Thu, 6 Oct 2022 09:43:16 +0000 (11:43 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 25 Oct 2022 11:25:00 +0000 (13:25 +0200)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19345)

ssl/quic/quic_stream.c

index 7e7d5417a4797ce9fb048240a183a060613a62e6..56d80cb56812ad3aa8f3d42dc3eb6b2b061f8108 100644 (file)
@@ -54,7 +54,7 @@ static void ring_buf_destroy(struct ring_buf *r)
 
 static size_t ring_buf_used(struct ring_buf *r)
 {
-    return r->head_offset - r->ctail_offset;
+    return (size_t)(r->head_offset - r->ctail_offset);
 }
 
 static size_t ring_buf_avail(struct ring_buf *r)
@@ -122,7 +122,7 @@ static int ring_buf_get_buf_at(const struct ring_buf *r,
     }
 
     idx = logical_offset % r->alloc;
-    l   = r->head_offset - logical_offset;
+    l   = (size_t)(r->head_offset - logical_offset);
     if (l > r->alloc - idx)
         l = r->alloc - idx;
 
@@ -315,7 +315,7 @@ int ossl_quic_sstream_get_stream_frame(QUIC_SSTREAM *qss,
         assert(i < 2);
 
         if (total_len + src_len > max_len)
-            src_len = max_len - total_len;
+            src_len = (size_t)(max_len - total_len);
 
         iov[num_iov_].buf       = src;
         iov[num_iov_].buf_len   = src_len;