Skip to content

Commit

Permalink
Use proper CanWrite method to safeguard TTY struct access (#1420)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlw committed Aug 21, 2024
1 parent c711129 commit ff0efe9
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ - (FileAccessPolicyDecision)handleMessage:(const Message &)msg

// Notify users on block decisions
if (ShouldNotifyUserDecision(policyDecision) &&
(!policy->silent || (!policy->silent_tty && msg->process->tty->path.length > 0))) {
(!policy->silent || (!policy->silent_tty && TTYWriter::CanWrite(msg->process)))) {
SNTCachedDecision *cd =
[self.decisionCache cachedDecisionForFile:msg->process->executable->stat];

Expand Down

0 comments on commit ff0efe9

Please sign in to comment.