--- tkcvs_7_2_2/tkdiff/tkdiff.cve-2005-3343 2006-01-03 12:34:05.078974734 -0700 +++ tkcvs_7_2_2/tkdiff/tkdiff 2006-01-03 12:34:05.080974369 -0700 @@ -444,13 +444,20 @@ } ############################################################################### -# Return the name of a temporary file +# Create a temporary file and return it's name ############################################################################### proc tmpfile {n} { global opts set tmpdir [file nativename $opts(tmpdir)] set tmpfile [file join $tmpdir "[pid]-$n"] + set access [list RDWR CREAT EXCL TRUNC] + set perm 0600 + if {[catch {set fid [open $tmpfile $access $perm]}]} { + # something went wrong + error "Failed creating temporary file: $errorCode" + } + close $fid return $tmpfile }