Skip to content

Commit 30846b4

Browse files
j6tttaylorr
authored andcommitted
gitk: sanitize 'exec' arguments: redirect to process
Convert one 'exec' call that sends output to a process (pipeline). Fortunately, the command does not contain any variables. For this reason, just treat it as a "redirection". Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 7a0493e commit 30846b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gitk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ proc safe_exec {cmd} {
4343
# executes one command with redirections
4444
# no pipelines are possible
4545
# cmd is a list that specifies the command and its arguments
46-
# redir is a list that specifies redirections (output, background)
46+
# redir is a list that specifies redirections (output, background, constant(!) commands)
4747
# calls `exec` and returns its value
4848
proc safe_exec_redirect {cmd redir} {
4949
eval exec [make_arglist_safe $cmd] $redir
@@ -9120,7 +9120,7 @@ proc getpatchid {id} {
91209120
if {![info exists patchids($id)]} {
91219121
set cmd [diffcmd [list $id] {-p --root}]
91229122
if {[catch {
9123-
set x [eval exec $cmd | git patch-id]
9123+
set x [safe_exec_redirect $cmd [list | git patch-id]]
91249124
set patchids($id) [lindex $x 0]
91259125
}]} {
91269126
set patchids($id) "error"

0 commit comments

Comments
 (0)