Skip to content

Commit

Permalink
Allocate a GENERAL_NAME before using it for a target
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomini committed Apr 29, 2024
1 parent 4c487ab commit 7ecb06e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/ac/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,18 @@ AC_TARGET* build_ac_target(char* t){
ASN1_IA5STRING_free(target_str);
return NULL;
}
GENERAL_NAME *name = GENERAL_NAME_new();
if (! name) {
AC_TARGET_free(target);
ASN1_IA5STRING_free(target_str);
return NULL;
}

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

GENERAL_NAME *name = target->name;

name->type = GEN_URI;
name->d.ia5 = target_str;
target->name = name;

return target;
}
Expand Down

0 comments on commit 7ecb06e

Please sign in to comment.