diff options
author | Richard Levitte <levitte@openssl.org> | 2022-10-05 10:52:59 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2022-10-25 13:25:00 +0200 |
commit | 5506fbeafb888751710f25e8658cf54136702e02 (patch) | |
tree | 67065f931ad7255ddfb13e65def737cc4334ec64 /ssl/quic/quic_rx_depack.c | |
parent | 4ccb89bba76655d72285f94619f2f4014319d3d9 (diff) | |
download | openssl-new-5506fbeafb888751710f25e8658cf54136702e02.tar.gz |
Fix 32-bit Windows issues related to QUIC_ACKM / QUIC_CC
The re-occuring surprise is that in Win32, size_t is 32 bits...
Fixed by changing size_t to uint64_t in QUIC_CC
Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19345)
Diffstat (limited to 'ssl/quic/quic_rx_depack.c')
-rw-r--r-- | ssl/quic/quic_rx_depack.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ssl/quic/quic_rx_depack.c b/ssl/quic/quic_rx_depack.c index 404d5b883e..42fb8ff34c 100644 --- a/ssl/quic/quic_rx_depack.c +++ b/ssl/quic/quic_rx_depack.c @@ -201,12 +201,14 @@ static int depack_do_frame_ack(PACKET *pkt, QUIC_CONNECTION *connection, int ok = 1; /* Assume the best */ if (!ossl_quic_wire_peek_frame_ack_num_ranges(pkt, &total_ranges) + /* In case sizeof(uint64_t) > sizeof(size_t) */ + || total_ranges > SIZE_MAX / sizeof(ack_ranges[0]) || (ack_ranges = OPENSSL_zalloc(sizeof(ack_ranges[0]) - * total_ranges)) == NULL) + * (size_t)total_ranges)) == NULL) return 0; ack.ack_ranges = ack_ranges; - ack.num_ack_ranges = total_ranges; + ack.num_ack_ranges = (size_t)total_ranges; if (!ossl_quic_wire_decode_frame_ack(pkt, ack_delay_exp, &ack, NULL)) ok = 0; |