From d3afe61b7812c14477cd0a8a8a2718d514e2ae39 Mon Sep 17 00:00:00 2001 From: Simon Rozman Date: Tue, 17 Jun 2025 16:35:43 +0200 Subject: [PATCH] Security: Use explicit handle validation Signed-off-by: Simon Rozman --- include/MacStd/Security.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/MacStd/Security.hpp b/include/MacStd/Security.hpp index b8af425..1ea3d80 100644 --- a/include/MacStd/Security.hpp +++ b/include/MacStd/Security.hpp @@ -61,7 +61,7 @@ namespace macstd case errAuthorizationInteractionNotAllowed: return "User interaction not allowed for authorization"; } cfstring cfstr(SecCopyErrorMessageString(num, NULL)); - if (!cfstr) + if (!cfstr.valid()) return "Security Framework error " + std::to_string(num); auto ptr = CFStringGetCStringPtr(cfstr, kCFStringEncodingUTF8); if (!ptr)