增加strname判空校验

Signed-off-by: 张余 <1459392684@qq.com>
Change-Id: I60b099f0330847c4ac5f74d2842f5cee8455c2cd
This commit is contained in:
张余 2024-08-29 10:48:15 +08:00
parent 7413e0382f
commit f71fcbf4c5

View File

@ -108,6 +108,10 @@ static int32_t ToStringName(FUNC func, const X509 *x509cert, const char *objname
X509_NAME_ENTRY *entry = X509_NAME_get_entry(name, i);
const char *strname = OBJ_nid2sn(OBJ_obj2nid(X509_NAME_ENTRY_get_object(entry)));
if (strname == NULL) {
continue;
}
if (strcmp(objname, strname) == 0) {
char *data = NULL;
length = ASN1_STRING_to_UTF8((unsigned char **)&data, X509_NAME_ENTRY_get_data(entry));