]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
script: Fix upper bounds
authorTobias Brunner <tobias@strongswan.org>
Wed, 4 Mar 2020 16:07:32 +0000 (17:07 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 4 Mar 2020 16:07:32 +0000 (17:07 +0100)
^ is the XOR operator.

scripts/crypt_burn.c
scripts/pubkey_speed.c

index bf338f0b4e000c38def0a6f2497caf35d395b47f..70ec4573a2976dec456feb55d4e3215cbd9f03cd 100644 (file)
@@ -196,7 +196,7 @@ int main(int argc, char *argv[])
        if (argc > 2)
        {
                len = atoi(argv[2]);
-               if (len > (2^30))
+               if (len > (1 << 30))
                {
                        fprintf(stderr, "buffer too large (1 GiB limit)\n");
                        return 1;
index 21e4d2c1ef8d6f8c51cb6bc9f9270d42fa42b044..0dcc7b0f54f8225f5397739f1433630f2d0e5cc7 100644 (file)
@@ -56,7 +56,7 @@ int main(int argc, char *argv[])
        }
 
        rounds = atoi(argv[3]);
-       if (rounds < 0 || rounds > (2^26))
+       if (rounds < 0 || rounds > (1 << 26))
        {       /* arbitrary limit to the number of chunk_t/sigs that fit into 1 GiB */
                usage();
        }