/* Encoding is kCFStringEncodingUTF8 since the string is either
PRINTABLE_STRING, IA5_STRING, T61_STRING or PKIX_UTF8_STRING. */
CFStringRef string = CFStringCreateWithBytes(NULL, it->Data, static_cast<CFIndex>(it->Length), kCFStringEncodingUTF8, true);
+ /* Be prepared for improperly formatted (non-UTF8) strings! */
+ if (!string) continue;
CFArrayAppendValue(array, string);
CFRelease(string);
}
/* Encoding is kCFStringEncodingUTF8 since the string is either
PRINTABLE_STRING, IA5_STRING, T61_STRING or PKIX_UTF8_STRING. */
CFStringRef string = CFStringCreateWithBytes(NULL, it->Data, static_cast<CFIndex>(it->Length), kCFStringEncodingUTF8, true);
+ /* Be prepared for improperly formatted (non-UTF8) strings! */
+ if (!string) continue;
CFArrayAppendValue(array, string);
CFRelease(string);
}