Solutionunvalidated
Guard the rewrite with a length/suffix check before subtracting 4 — write_backup_file(). Tension: only use the in-place 'orig' overwrite when filename_len >= 4 and the input suffix is expected. Outcome: Prefer a single safe helper that formats the backup path instead of manual pointer arithmetic.
0a877bdc-3988-4d84-a08e-4537f249f1a0
Guard the rewrite with a length/suffix check before subtracting 4 — write_backup_file(). Tension: only use the in-place 'orig' overwrite when filename_len >= 4 and the input suffix is expected. Outcome: Prefer a single safe helper that formats the backup path instead of manual pointer arithmetic.