Skip to content

Commit d4dddcb

Browse files
committed
fix(engine): quote patchFile in read-error wrap for consistency
Address review feedback from gemini-code-assist on pkg/engine/engine.go:231: the read-error wrap was the only patchFile interpolation in MergeFileAsPatch still using %s; every other site in the function uses %q. Switch to %q so user-controlled paths are quoted consistently and a path with shell metacharacters cannot land in a hint as a copy-paste hazard. Assisted-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
1 parent 398448c commit d4dddcb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎pkg/engine/engine.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func MergeFileAsPatch(rendered []byte, patchFile string) ([]byte, error) {
228228
patchBytes, err := os.ReadFile(patchFile)
229229
if err != nil {
230230
return nil, errors.WithHint(
231-
errors.Wrapf(err, "reading patch %s", patchFile),
231+
errors.Wrapf(err, "reading patch %q", patchFile),
232232
"verify the path is correct and the file is readable by the user running talm",
233233
)
234234
}

0 commit comments

Comments
 (0)