]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:utils: Align integer type
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 30 Oct 2023 22:33:39 +0000 (11:33 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 2 Nov 2023 03:08:37 +0000 (03:08 +0000)
If ‘count’ is larger than INT_MAX, ‘i’ might overflow in the loop and
lead to undefined behaviour.

See also CID 1548342.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpc_client/wsp_cli.c

index 91e5ebb3b55d9b71c56ffef8ca759ada1c7ab663..34eb1bc2696a52591ba96e9976130f1f415e1574 100644 (file)
@@ -981,7 +981,7 @@ static enum ndr_err_code extract_variant_addresses(TALLOC_CTX *ctx,
                vec_address[0] = addr;
        } else {
                uint64_t array_addr = addr;
-               int i;
+               uint64_t i;
                for (i = 0; i < count; i++) {
                        if (is_64bit) {
                                vec_address[i] =