]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
quic: use the safe fused multiply divide instead of a safe multiply then a normal...
authorPauli <pauli@openssl.org>
Mon, 17 Jul 2023 01:06:35 +0000 (11:06 +1000)
committerPauli <pauli@openssl.org>
Fri, 4 Aug 2023 01:55:34 +0000 (11:55 +1000)
This should extend the range of possible results.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21429)

ssl/quic/quic_fc.c

index 25a10b4ebe799ec96e351b99413cb7478a5b7dab..caf69a1d67f30e5e19adfdb032a324f6f1ce2617 100644 (file)
@@ -236,8 +236,8 @@ static int rxfc_cwm_bump_desired(QUIC_RXFC *rxfc)
     int err = 0;
     uint64_t window_rem = rxfc->cwm - rxfc->rwm;
     uint64_t threshold
-        = safe_mul_uint64_t(rxfc->cur_window_size,
-                            WINDOW_THRESHOLD_NUM, &err) / WINDOW_THRESHOLD_DEN;
+        = safe_muldiv_uint64_t(rxfc->cur_window_size,
+                               WINDOW_THRESHOLD_NUM, WINDOW_THRESHOLD_DEN, &err);
 
     if (err)
         /*