pud: fix position file stat/use race
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 22 Oct 2012 10:48:29 +0000 (12:48 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 22 Oct 2012 11:55:39 +0000 (13:55 +0200)
commit22dd4de9e186157924327427344ec995a0e9bb31
treed76cd3382e832981b02cae2f44e909c066de14c8
parent1aeaf0d99cbadb8259a7180ca96005d5aff2d282
pud: fix position file stat/use race

Coverity:
CID 739696 (#1 of 1): Time of check time of use (TOCTOU)
At (1): Calling function "stat(char const * restrict,
                               struct stat * restrict)"
        to perform check on "fileName".
At (4): Calling function "fopen(char const * restrict,
                                char const * restrict)"
        that uses "fileName" after a check function. This can cause a
        time-of-check, time-of-use race condition.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/posFile.c