Skip to content

Commit 7ecb06e

Browse files
committed
Allocate a GENERAL_NAME before using it for a target
1 parent 4c487ab commit 7ecb06e

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/ac/write.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,18 @@ AC_TARGET* build_ac_target(char* t){
7575
ASN1_IA5STRING_free(target_str);
7676
return NULL;
7777
}
78+
GENERAL_NAME *name = GENERAL_NAME_new();
79+
if (! name) {
80+
AC_TARGET_free(target);
81+
ASN1_IA5STRING_free(target_str);
82+
return NULL;
83+
}
7884

7985
ASN1_STRING_set(target_str, t, strlen(t));
8086

81-
GENERAL_NAME *name = target->name;
82-
8387
name->type = GEN_URI;
8488
name->d.ia5 = target_str;
89+
target->name = name;
8590

8691
return target;
8792
}

0 commit comments

Comments
 (0)