lib/compression: Fix length check
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 9 Jan 2023 02:00:14 +0000 (15:00 +1300)
committerJeremy Allison <jra@samba.org>
Tue, 10 Jan 2023 20:22:32 +0000 (20:22 +0000)
Put the division on the correct side of the inequality.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/compression/pycompression.c

index 00a207008fb7bf4f299f428455c622c2fd2c93cc..f67b0ddbe39ba22488a9108d2d6f16c8c383712c 100644 (file)
@@ -126,7 +126,7 @@ static PyObject *plain_decompress(PyObject *mod, PyObject *args)
                 */
                if (src_len <= 3333333) {
                        alloc_len = 10000000;
-               } else if (src_len / 3 >= UINT32_MAX) {
+               } else if (src_len > UINT32_MAX / 3) {
                        alloc_len = UINT32_MAX;
                } else {
                        alloc_len = src_len * 3;