Skip to content

Commit

Permalink
Replace sprintf with snprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
nikias committed Sep 18, 2024
1 parent 1f860ef commit 1e161fc
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/tss.c
Original file line number Diff line number Diff line change
Expand Up @@ -1420,31 +1420,31 @@ int tss_request_add_timer_tags(plist_t request, plist_t parameters, plist_t over
return -1;
}
char key[64];
sprintf(key, "@%s", plist_get_string_ptr(node, NULL));
snprintf(key, 64, "@%s", plist_get_string_ptr(node, NULL));

plist_dict_set_item(request, key, plist_new_bool(1));

tag = (uint32_t)plist_dict_get_uint(parameters, "TagNumber");

sprintf(key, "Timer,BoardID,%u", tag);
snprintf(key, 64, "Timer,BoardID,%u", tag);
plist_dict_copy_uint(request, parameters, key, NULL);

sprintf(key, "Timer,ChipID,%u", tag);
snprintf(key, 64, "Timer,ChipID,%u", tag);
plist_dict_copy_uint(request, parameters, key, NULL);

sprintf(key, "Timer,SecurityDomain,%u", tag);
snprintf(key, 64, "Timer,SecurityDomain,%u", tag);
plist_dict_copy_uint(request, parameters, key, NULL);

sprintf(key, "Timer,SecurityMode,%u", tag);
snprintf(key, 64, "Timer,SecurityMode,%u", tag);
plist_dict_copy_bool(request, parameters, key, NULL);

sprintf(key, "Timer,ProductionMode,%u", tag);
snprintf(key, 64, "Timer,ProductionMode,%u", tag);
plist_dict_copy_bool(request, parameters, key, NULL);

sprintf(key, "Timer,ECID,%u", tag);
snprintf(key, 64, "Timer,ECID,%u", tag);
plist_dict_copy_uint(request, parameters, key, NULL);

sprintf(key, "Timer,Nonce,%u", tag);
snprintf(key, 64, "Timer,Nonce,%u", tag);
plist_dict_copy_data(request, parameters, key, NULL);

char *comp_name = NULL;
Expand Down

0 comments on commit 1e161fc

Please sign in to comment.