]> git.ipfire.org Git - thirdparty/json-c.git/commitdiff
random_seed.c: add a Coverity Scan suppression 849/head
authorEven Rouault <even.rouault@spatialys.com>
Sun, 7 Jan 2024 19:55:35 +0000 (20:55 +0100)
committerEven Rouault <even.rouault@spatialys.com>
Sun, 7 Jan 2024 19:55:38 +0000 (20:55 +0100)
Coverity Scan warns about the use of open() after stat() being a
potential TOCTOU (Time of check time of use) issue. But here there is no
such issue.

random_seed.c

index 5b2155dbcdcab0be5289c18433590f3d962e51b7..a033fac29095a10aa6a236170b3159238bfa408b 100644 (file)
@@ -229,6 +229,7 @@ static int get_dev_random_seed(int *seed)
        if ((buf.st_mode & S_IFCHR) == 0)
                return -1;
 
+       /* coverity[toctou] */
        int fd = open(dev_random_file, O_RDONLY);
        if (fd < 0)
        {