From ff0efe952b2456b52fad2a40e6eedb0931e6bdf7 Mon Sep 17 00:00:00 2001 From: Matt W <436037+mlw@users.noreply.github.com> Date: Wed, 21 Aug 2024 16:29:33 -0400 Subject: [PATCH] Use proper CanWrite method to safeguard TTY struct access (#1420) --- .../EventProviders/SNTEndpointSecurityFileAccessAuthorizer.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/santad/EventProviders/SNTEndpointSecurityFileAccessAuthorizer.mm b/Source/santad/EventProviders/SNTEndpointSecurityFileAccessAuthorizer.mm index 7c688d81c..2c85713f0 100644 --- a/Source/santad/EventProviders/SNTEndpointSecurityFileAccessAuthorizer.mm +++ b/Source/santad/EventProviders/SNTEndpointSecurityFileAccessAuthorizer.mm @@ -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];