Commit fa97ea5
committed
Fix CodeQL TOCTOU: use fchmod before fclose on gate script
CodeQL cpp/toctou-race-condition #32: fopen then chmod on the same
path allows a race where the file could be swapped between write
and chmod. Fix: use fchmod(fileno(f)) before fclose on POSIX.
Windows falls back to chmod (no fchmod).1 parent aa5237b commit fa97ea5
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1559 | 1559 | | |
1560 | 1560 | | |
1561 | 1561 | | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
1562 | 1566 | | |
| 1567 | + | |
1563 | 1568 | | |
| 1569 | + | |
1564 | 1570 | | |
1565 | 1571 | | |
1566 | 1572 | | |
| |||
0 commit comments