Skip to content
Permalink
Browse files Browse the repository at this point in the history
coolkey: Make sure the object ID is unique when filling list
  • Loading branch information
Jakuje authored and frankmorgner committed Dec 4, 2019
1 parent 32b4989 commit c246f6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/libopensc/card-coolkey.c
Expand Up @@ -1945,6 +1945,11 @@ coolkey_add_object(coolkey_private_data_t *priv, unsigned long object_id, const
new_object.id = object_id;
new_object.length = object_length;

/* The object ID needs to be unique */
if (coolkey_find_object_by_id(&priv->objects_list, object_id) != NULL) {
return SC_ERROR_INTERNAL;
}

if (object_data) {
new_object.data = malloc(object_length + add_v1_record);
if (new_object.data == NULL) {
Expand Down

0 comments on commit c246f6f

Please sign in to comment.