src/bin: fix possible toctou in erase

Found by Coverity Scan

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-08-04 08:07:38 +02:00
parent 9aacd251b8
commit bdc391b4ce
-4
View File
@@ -26,10 +26,6 @@ static int do_erase(const char *path)
}
cfg_adjust(path, NULL, fn, len);
if (access(fn, F_OK)) {
fprintf(stderr, "No such file: %s\n", fn);
return -1;
}
} else
fn = (char *)path;