Commit b7d91e4
committed
bin: fix Coverity Scan issues in copy command
Address two issues identified by Coverity Scan:
1. CID 550484 (TOCTOU): Remove access() check before realpath()
- realpath() already fails if file doesn't exist, making the
access() check redundant and introducing a TOCTOU race
- Simplifies code while improving security
2. CID 550483 (CHECKED_RETURN): Mark unchecked remove() calls
- Add (void) cast to two remove() calls to explicitly indicate
we don't care about the return value
- These are cleanup operations for temp files where failure
is acceptable, even expected
Signed-off-by: Joachim Wiberg <[email protected]>1 parent 171b757 commit b7d91e4
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | | - | |
| 381 | + | |
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
131 | | - | |
| 131 | + | |
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| |||
0 commit comments