Skip to content

Commit

Permalink
Use proper CanWrite method to safeguard TTY struct access
Browse files Browse the repository at this point in the history
  • Loading branch information
mlw committed Aug 21, 2024
1 parent c711129 commit 5f54767
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 5f54767

Please sign in to comment.