Skip to content

Commit

Permalink
Sanitize inputs to eval() (#6745)
Browse files Browse the repository at this point in the history
  • Loading branch information
loadams authored Nov 13, 2024
1 parent 877aa0d commit 9a2c209
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/model/BingBertSquad/run_BingBertSquad.sh
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,11 @@ run_cmd="deepspeed.pt \
--master_port ${master_port}
${BingBertSquad_script} ${other_args} ${squad_args}"

echo ${run_cmd}
eval ${run_cmd}
# Sanitize input before running eval()
safe_cmd=$(printf '%q' "$run_cmd")

echo ${safe_cmd}
eval ${safe_cmd}

set +x

Expand Down

0 comments on commit 9a2c209

Please sign in to comment.