Security: Use explicit handle validation

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2025-06-17 16:35:43 +02:00
parent 3fe0006b22
commit d3afe61b78

View File

@ -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)