fixed copy into fixed size buffer

This commit is contained in:
Frank Morgner 2015-01-28 04:30:40 +01:00
parent b6a935a261
commit fdd38f6e04
2 changed files with 2 additions and 2 deletions

View File

@ -261,7 +261,7 @@ static int insert_pin(
static char *dirpath(char *dir, const char *path){
static char buf[SC_MAX_PATH_STRING_SIZE];
strcpy(buf,dir);
strlcpy(buf,dir,sizeof buf);
strlcat(buf,path,sizeof buf);
return buf;
}

View File

@ -350,7 +350,7 @@ sc_pkcs15init_bind(struct sc_card *card, const char *name, const char *profile_o
* If none is defined, use the default profile name.
*/
if (!get_profile_from_config(card, card_profile, sizeof(card_profile)))
strcpy(card_profile, driver);
strclpy(card_profile, driver, sizeof card_profile);
if (profile_option != NULL)
strlcpy(card_profile, profile_option, sizeof(card_profile));