ret = get_attribute_text(&afd->afsi.attributes, " ", &tmp);
if (ret < 0)
goto err;
- tmp[sizeof(afd->attributes_string) - 1] = '\0';
- strcpy(afd->attributes_string, tmp); /* OK */
+ assert(tmp);
+ strncpy(afd->attributes_string, tmp, sizeof(afd->attributes_string));
+ afd->attributes_string[sizeof(afd->attributes_string) - 1] = '\0';
free(tmp);
aced.aft_row = aft_row;
mmd->afd.afhi.chunk_table = NULL;
tmp = make_message("%s:\n%s:\n%s:\n", status_item_list[SI_AUDIO_INFO1],
status_item_list[SI_AUDIO_INFO2], status_item_list[SI_AUDIO_INFO3]);
- strcpy(mmd->afd.afhi.info_string, tmp);
+ strncpy(mmd->afd.afhi.info_string, tmp, sizeof(mmd->afd.afhi.info_string));
+ mmd->afd.afhi.info_string[sizeof(mmd->afd.afhi.info_string) - 1] = '\0';
free(tmp);
mmd->afd.path[0] = '\0';
mmd->afd.afsi.lyrics_id = 0;