Solutionunvalidated
replace fopen(filename, "rb") existence check with lstat(filename, &fileinfo) — in tool_create_output_file. Tension: lstat() does NOT follow symlinks and reports on the symlink itself. Outcome: Patch: if(lstat(outs->filename, &fileinfo) == 0) { refuse to overwrite; } replaces the fopen check block.
8a0d2f1b-7b60-4402-aeda-859ba8796b8f
replace fopen(filename, "rb") existence check with lstat(filename, &fileinfo) — in tool_create_output_file. Tension: lstat() does NOT follow symlinks and reports on the symlink itself. Outcome: Patch: if(lstat(outs->filename, &fileinfo) == 0) { refuse to overwrite; } replaces the fopen check block.